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

2 Answers 2


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.

  • This was tremendously helpful, thank you! Commented Aug 23, 2023 at 4:07

I had yiisoft/yii2 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 and then it worked fine.

  • Helped a lot, thanks
    – RomanAvr
    Commented Sep 19, 2023 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.