22415 Posts in 6944 Topics by 2750 members
|Go to End|
3 March 2011 at 9:39pm Last edited: 3 March 2011 9:43pm
I'm having a problem with my PHP memory limit. When trying to go to the admin login page, I get this error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 491520 bytes) in /home/meltscom/public_html/silverstripe-cache/.cache.home.meltscom.public_html.sapphire.template s.TableListField.ss on line 622
I have tried changing php.ini to memory_limit = 256M manually, but it doesn't help. What else can I do to up the limit to prevent this from happening?
I've also tried changing max_execution_time to 1000. I have also found and corrected ini_set('memory_limit', '256M'); in sapphire/_config.php, and added the same line to mysite/_config.php.
Edit: I have run phpinfo, which confirms the memory limit is set to 256M....so I'm very stuck now
Edit: I found in another thread a suggestion to add php_value memory_limit 256M to the .htaccess file, I was just wondering where to add it because adding that exact line at the bottom of the .htaccess file in the root folder causes an Internal Server Error for the entire site (not just the admin page as the original error did).
4 March 2011 at 1:39am Last edited: 4 March 2011 3:06am
I'd do the normal debugging stuff and find out what it is that is causing the issue...
I have this recently with an image that on upload went from 1.3MB to 13MB and it was then being scalled down - I could see the GD section of code and filename and could then manually change the image. So you should be able to find something that indicates the issue and you can make a db/code/asset change to fix...
27 July 2011 at 11:09am
I had someone contact me about this post because they were having the same issue, so I thought I would post the solution here for the benefit of anyone else who needs it.
It was a friend of mine who found the solution to this one. In the home directory you should have a php.ini file (or if not, create one - contact your host if you don't know how to do it, mine has a tool that generates it). Then increase the memory limit setting to 128M or higher.
This alone however may not solve it. What solved it for me, as my friend worked out, is to put a copy of the php.ini file inside the sapphire directory as well as in the home directory. I honestly don't know why this works, maybe sapphire accesses something else by default and this overrides it, I don't know, but this worked for me.
Hope this is helpful!
|Go to Top|