PHP Memory allocation error in php 7.1

Silverstripe Version:

I am trying to switch from php 5.6 to php 7.1 and am now getting an error

PHP Fatal error:  Allowed memory size of 94371840 bytes exhausted (tried to allocate 20480 bytes) in framework/core/Config.php on line 479

I have tried several sites and they work fine in php 5.6 but all give the error in php 7.1

Has anyone had similar issues that they have resolved?

Hi @MilesSummers,

Please check the memory_limit variable in the php.ini file. You can set the value like,

memory_limit = 512MB

Then make sure to do apache service restart.


Unfortunately I do not have access to the php.ini file

Then you can also set in .htaccess file like,

php_value memory_limit 256M

I have tried increasing the memory limit to 256M and still get the memory allocation error. What I don’t understand is that the site works with 94371840 bytes memory limit in php 5.6 but seems to give me the error only in php 7.x

Make sure there are no cached files around; they may be causing issues.

If you have a silverstripe-cache directory in the web root, make sure it’s empty and try running a dev/build?flush

If you don’t… try creating one, and do the same.

Thanks - that did the trick