InMotion Hosting Support Center

PHP Fatal Error message Out of memory.

2013-06-19 11:27 pm EST

Hits: 2,164
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.



43,761 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 ( to make the php recursive. I have download a memory test script ( 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?
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.

Arnel C.
40,963 Points
2013-06-20 7:44 pm EST
From my research, we come across this post about Cpanel RlimitMEM might affect script to run:
I am not able to review the httpd.conf file and please validate if we can remoe rlimitmem or rlimitcpu setting?
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.


Arnel C.
40,963 Points
2013-06-20 8:18 pm EST
Like this Question?

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Need more Help?


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:
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!