Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

PHP memory limit issue


Reply

5 Posts   1722 Views

Avatar
dkm

30 April 2009 at 12:53pm Community Member, 4 Posts

I know the topic has been beatin' like a dead horse, but I've run into an problem on a clients site. The failure happens when trying to access the CMS (admin section). Here's the error from the Apache error.log:

[Wed Apr 29 17:17:43 2009] [error] [client 68.183.195.206] PHP Fatal error: Out of memory (allocated 16252928) (tried to allocate 46 bytes) in /usr/local/www/vhosts/ropepartner.com/httpdocs/sapphire/forms/OptionsetField.php on line 70

Now, the hosting provider claims the PHP memory limit is set to 128M. As a check I made phpinfo() call in a script and phpinfo states the memory_limit is set to 128M. From the error, though, it looks like PHP is failing at around 16M.

Any ideas?

Avatar
rbquirke

30 April 2009 at 2:36pm Community Member, 70 Posts

See if you can set it explicitly in the .htaccess with this line:
php_value memory_limit 128M

- may or may not work depending on the hosting provider's settings

Avatar
dkm

30 April 2009 at 3:34pm Community Member, 4 Posts

Thanks rbquirke,

Yeah, I've tried explicitly set the memory limit to 128M in both .htaccess and sapphire/main.php but it hasn't helped.

Avatar
Double-A-Ron

30 April 2009 at 10:03pm Community Member, 604 Posts

That's a weird one. I suppose you've cleared your browser cache?

Who's the host?

Avatar
dkm

1 May 2009 at 4:41am Community Member, 4 Posts

Yep, tried that too. I only thing I can come up with is that it may be and issue with Apache and the RLimitMEM directive being set to 16 megs. I think PHP is running under FastCGI (I'm not sure yet, I haven't heard back from the hosting provider) and if so I believe that the memory limit set by RLimitMEM kicks in and will override any value set in php.ini or elsewhere.

The hosting provider is just a local one here in town. We have two other clients running SS on their hosts without any issues.