<p><a href="https://github.com/craftcms/cms/releases/tag/3.6.17" rel="nofollow noreferrer">Craft version 3.6.17 was released in June 2021</a>, while PHP 8.1 had its first stable release in November 2021. The latest PHP version Craft could support at that point was 8.0, so you're running this version of Craft on an unsupported PHP version. That's why your getting errors.</p>
<p>To fix this issue and prepare for the Craft 4 update, first update to the last stable 3.x version, as <a href="https://craftcms.com/docs/4.x/upgrade.html#preparing-for-the-upgrade" rel="nofollow noreferrer">mentioned in the update guide</a>. This one will support newer PHP versions.</p>
<p>If you can't use the Craft binary (<code>php craft update all</code>) because it's giving you errors as well, you can use Composer to update the library instead. Then run <code>php craft up</code> to execute any required migrations. However, the better approach is to do the update first, and <strong>then</strong> bump your PHP version.</p>

CC BY-SA 4.0
2023-10-16T14:56:06.147Z
Thanks for the answer, I will give it a shot. The weird thing is though I have two other sites that are both running 3.6.17 and still work fine after updating the PHP.
Justin Kendall
CC BY-SA 4.0
2023-10-16T15:12:53.450Z
@JustinKendall The specific error is coming from ImageMagick, maybe the other sites are using GD? Anyway, updating the Craft version is recommended in either case, there could be other errors that you are not seeing due to the version mismatch. And it's required before you update to Craft 4 anyway.
MoritzLost
CC BY-SA 4.0
2023-10-16T14:50:28.173Z
2023-10-16T14:50:28.173Z
MoritzLost
<p>I upgraded my server to PHP 8.1.22 in order to start a new Craft 4 site, and one (but not all) of my existing Craft 3 (3.6.17) sites is giving me the following error. <strong>How do I resolve this error?</strong> See error screenshot below:<a href="https://i.sstatic.net/Bzrsu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Bzrsu.png" alt="Craft PHP Error" /></a></p>

<craft3><php>
Updated to PHP version 8.1.22 and one of my Craft 3 sites is getting a critical error
# Updated to PHP version 8.1.22 and one of my Craft 3 sites is getting a critical error

(Asked by: username_0 on 2023-10-16)

I upgraded my server to PHP 8.1.22 in order to start a new Craft 4 site, and one (but not all) of my existing Craft 3 (3.6.17) sites is giving me the following error. **How do I resolve this error?** See error screenshot below:[![Craft PHP Error](https://i.sstatic.net/Bzrsu.png)](https://i.sstatic.net/Bzrsu.png)

**Tags:** craft3, php

---

## 1 answers

### Answer by username_1 on 2023-10-16. Score: 3 | Accepted answer

[Craft version 3.6.17 was released in June 2021](https://github.com/craftcms/cms/releases/tag/3.6.17), while PHP 8.1 had its first stable release in November 2021. The latest PHP version Craft could support at that point was 8.0, so you're running this version of Craft on an unsupported PHP version. That's why your getting errors.

To fix this issue and prepare for the Craft 4 update, first update to the last stable 3.x version, as [mentioned in the update guide](https://craftcms.com/docs/4.x/upgrade.html#preparing-for-the-upgrade). This one will support newer PHP versions.

If you can't use the Craft binary (`php craft update all`) because it's giving you errors as well, you can use Composer to update the library instead. Then run `php craft up` to execute any required migrations. However, the better approach is to do the update first, and **then** bump your PHP version.

> **Comments:**
> **username_0**: Thanks for the answer, I will give it a shot. The weird thing is though I have two other sites that are both running 3.6.17 and still work fine after updating the PHP.  
> **username_1**: @JustinKendall The specific error is coming from ImageMagick, maybe the other sites are using GD? Anyway, updating the Craft version is recommended in either case, there could be other errors that you are not seeing due to the version mismatch. And it's required before you update to Craft 4 anyway.  

---

