3

I'm trying to update Craft to the latest version of Craft 3, I can get as far as version 3.7.8, but any version higher than that causes an error 500 on both front and backend.

I'm using a Mac and Mamp and in phperrors.log, I can see this error:

[24-May-2023 10:38:40 UTC] PHP Fatal error: Declaration of craft\helpers\FileHelper::getExtensionByMimeType($mimeType): string must be compatible with yii\helpers\BaseFileHelper::getExtensionByMimeType($mimeType, $preferShort = false, $magicFile = null) in /Users/user/Desktop/Websites/SiteName/craft/vendor/craftcms/cms/src/helpers/FileHelper.php on line 719

Mark
  • 287
  • 1
  • 9

2 Answers2

6

Answer - for some reason the highest version of Craft the update was offering was 3.7.19

Checking online showed that 3.8.12 was available, going straight to this version with php craft update craft:3.8.12 resolved the issue and the update was successful.

Mark
  • 287
  • 1
  • 9
2

I had yiisoft/yii2 4.0.48.1 installed when I tried to upgrade and experienced the exact same issue above craftcms/cms "3.7.8. The version of yii2 to use wasn't specified in my composer.json file. I downgraded yiisoft/yii2 to version 2.0.43 with composer require yiisoft/yii2 2.0.42.1 and then it worked fine.

LeeMel
  • 21
  • 1