PHP Fatal Error message Out of memory.


CanopyValley
Asked:
2013-06-19 11:27 pm EST

Hits: 1,446
Hello Team,
Could you please kindly shine me some light on the PHP out of memory error?
I have a local PHP.ini setup with memory_limit set to 512. I have redirect the error log to ~/public_html/logs/my_php_error.log

What puzzle me is the error message we get is something similar to the one below
"[19-Jun-2013 07:14:30 America/Los_Angeles] PHP Fatal error: Out of memory (allocated 45875200) (tried to allocate 72 bytes) in ..."

We have validate our memory setting using phpinfo() and confirm the memory_limit is set to 512. We also use a memory script to test the memory actually can went up to 512M. However, the error indicate a fatal error of out of memory, allocated 45875200 (about 43.7 MB)

Can you please help address the issue? thanks

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

Scott
Staff
17,014 Points
2013-06-20 9:31 am EST
Hello CanopyValley,

When you change the settings in the php.ini file, they will only function for the files in that particular folder. The subfolders do not abide by the changes in the php.ini unless you have it set to be recursive. You will need to set the php.ini to be recursive via the .htaccess file. This will pass the 512MB limit to all folders under the public_html folder. Give that a try and see if it helps with the memory error.

Best Regards,
Scott M

You must login before you can post a comment about this answer.

Thanks Scott, I have follow the other link (http://www.inmotionhosting.com/support/website/general-server-setup/recursive-php-ini) to make the php recursive. I have download a memory test script (http://magazine.joomla.org/issues/issue-dec-2010/item/295-Are-you-getting-your-fair-share-of-PHP-memory) and it actually show php can go up to 200+MB. The same error happened again this morning between 10:22:01 and 10:22"04 server time ([20-Jun-2013 10:22:01 America/Los_Angeles] PHP Fatal error: Out of memory (allocated 48758784) ) Any suggestions why I can get 200+ MB memory on some script and fail to get 48MB on the others?
CanopyValley
32 Points
2013-06-20 6:54 pm EST
Hello CanopyValley,

I had a tier2 tech review this since they could access your VPS and take a look at your actual files. The error logs are a bit odd showing missing files (specifically for style.css and a few other files). It could account for the different usages in memory as well, since sometimes some files are okay and then sometimes they're not. However, we're not sure of the exact cause of your memory errors. It does not appear to be a server related issue as we would see errors in the log related to that issue. The tier2 recommend setting the memory limit higher than 512 MB and see what you get. It's also possible that another script was running that occupied the memory at the same time and would not relinquish resulting in the different levels of memory for the message. Therefore, if you raise the limit, then there should be a larger memory pool for the multiple scripts to run and possibly resolve this error. I hope this makes sense to you!

If you have any further questions or require further assistance, please let us know.

Regards,
Arnel C.
Arn
16,176 Points
Staff
2013-06-20 7:44 pm EST
From my research, we come across this post about Cpanel RlimitMEM might affect script to run: http://forums.cpanel.net/f5/rlimitmem-troubles-136257.html
I am not able to review the httpd.conf file and please validate if we can remoe rlimitmem or rlimitcpu setting?
CanopyValley
32 Points
2013-06-20 8:12 pm EST
Hello Canopyvalley,

Regarding rlimitmem or rlimitcpu: Neither of those are set on your server(or any of our servers. The tier2 double-checked and its not on the server at all.

Regards,

Arnel C.
Arn
16,176 Points
Staff
2013-06-20 8:18 pm EST
Like this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!