I renamed a channel section and Craft (2.6.3012) is trying to resave all the entries therein (about 500 entries, many with up to 10 localized versions). I'm constantly getting this error (in /craft/storage/runtime/logs/phperrors.log):

[26-Mar-2018 15:53:40 UTC] PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 43 bytes) in C:\server\project_x\craft\app\helpers\ModelHelper.php on line 95

Here's the thing... in php.ini, the memory_limit setting is set to 512M. Not the 256M one would expect from the error. In Craft's admin/utils/phpinfo page, it shows that PHP does indeed have a limit of 512Mb, but the process still hits a mysterious memory limit at 256MB.

I'm running locally on XAMPP, PHP 5.6.24 (switching to PHP 7 prevents me from being able to login for some reason), and this is just part of setting up a site, so I don't care about performance or advisable settings with this issue.

What am I missing?


Most likely you'll need to add this line to the Craft config file (craft/config/general.php)...

'phpMaxMemoryLimit' => '512M',
  • I don't know if there is a behaviour difference between Craft 2 and 3, but reading the Craft 3 docs suggests not specifying phpMaxMemoryLimit i.e. null basically means it will try and use the max available anyway, so why set a fixed value? Feb 16 at 10:13

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .