I'm trying to migrate to a server from my local environment. I keep getting Internal Server Error. I have the latest version of 3+ of CraftCMS. Everything works fine locally but on the server not so much. Here is what I'm seeing in my Craft log file.

    2019-02-08 05:02:35 [-][-][-][error][yii\base\ErrorException:8] yii\base\ErrorException: unserialize(): Error at offset 352 of 93525 bytes in /home/kinoliclients/public_html/jbbls/cms/vendor/craftcms/cms/src/services/ProjectConfig.php:997
Stack trace:
#0 /home/kinoliclients/public_html/jbbls/cms/vendor/craftcms/cms/src/web/ErrorHandler.php(76): yii\base\ErrorHandler->handleError(8, 'unserialize(): ...', '/home/kinolicli...', 997)
#1 [internal function]: craft\web\ErrorHandler->handleError(8, 'unserialize(): ...', '/home/kinolicli...', 997, Array)
#2 /home/kinoliclients/public_html/jbbls/cms/vendor/craftcms/cms/src/services/ProjectConfig.php(997): unserialize('a:17:{s:12:"dat...', Array)
#3 /home/kinoliclients/public_html/jbbls/cms/vendor/craftcms/cms/src/services/ProjectConfig.php(982): craft\services\ProjectConfig->_getStoredConfig()
#4 /home/kinoliclients/public_html/jbbls/cms/vendor/craftcms/cms/src/services/ProjectConfig.php(912): craft\services\ProjectConfig->_getLoadedConfig()
#5 /home/kinoliclients/public_html/jbbls/cms/vendor/craftcms/cms/src/services/ProjectConfig.php(227): craft\services\ProjectConfig->_getConfigurationFromYaml()
#6 /home/kinoliclients/public_html/jbbls/cms/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\services\ProjectConfig->init()
#7 [internal function]: yii\base\BaseObject->__construct(Array)

The PHP log file gives a bit more information.

[08-Feb-2019 13:36:48 UTC] PHP Notice:  unserialize(): Error at offset 352 of 93525 bytes in /home/kinoliclients/public_html/jbbls/cms/vendor/craftcms/cms/src/services/ProjectConfig.php on line 997
[08-Feb-2019 13:36:48 UTC] An Error occurred while handling another error:
TypeError: Return value of craft\services\ProjectConfig::_getStoredConfig() must be of the type array, boolean returned in /home/kinoliclients/public_html/jbbls/cms/vendor/craftcms/cms/src/services/ProjectConfig.php:997
Stack trace:
#0 /home/kinoliclients/public_html/jbbls/cms/vendor/craftcms/cms/src/services/ProjectConfig.php(982): craft\services\ProjectConfig->_getStoredConfig()

Also, just for context. I had the site running on the remote server but then did an update (the one that said, this is a difficult update). The update put it in a vegetative state (internal server error). The same update worked locally, so I then copied the files and database to the remote server hoping that would fix the issue remotely. However, it didn't. Was their a new PHP extension requirement or something, that might have done this?

  • Fly by guess: have you checked if a YAML file was created for projects and if this exists in both places? – joomkit Feb 8 '19 at 14:18
  • No, their is no YAML file. Does PHP read that for something? I don't have that file locally where everything works, so I can't imagine that's the issue. – kinoli Feb 9 '19 at 0:13
  • Try clearing out the Craft storage/runtime/cache folder. – Brad Bell Feb 11 '19 at 3:21

It ended up being an unserialization issue. After exporting the sql file, I updated it with the new domain. The serialization part within the craft_info table needs to have the correct character length in front of the domain. Fixing that fixed my problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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