HostGator.com » Support Portal

PHP Memory Limit Error

Allowed Memory Size Exhausted Errors

Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 23456789 bytes) in somefile.php
Fatal Error: PHP Allowed Memory Size Exhausted

These errors occur when PHP tries to process a large database record, or when importing or exporting a database.

To fix the problem, please modify the memory_limit line in php.ini to match this example:

memory_limit = 256M

We do set the maximum memory limit at 256 MB (268,435,456 bytes). If you want to go higher, you will need a VPS plan or dedicated server.

So, if you see "Allowed memory size of 168435456 bytes exhausted..." in the error, then you cannot increase the limit any higher without a VPS plan or dedicated server. Dedicated Server and VPS customers with WHM access can change the limit by going to WHM > Service Configuration > PHP Configuration Editor.


Out of Memory Error

Fatal error: Out of memory (allocated 168435456) (tried to allocate 47 bytes) in somefile.php

If you see less than 168435456 bytes total allocated and being allocated, but still get an error like the example above, then we suggest you contact HostGator support to get assistance and advice.


Need help?

If you need assistance with correcting this error, please feel free to contact us, and we will be happy to help you.

Article Comments

Andrew
You should offer a tiered package which has a larger memory_limit and other associated values. Seems a bit much to go to a dedicated server just because memory_limit of 128M or 256M is required.

HostGator
We have a new set of plans which falls between shared hosting and dedicated servers, which will satisfy your request.

The new type of hosting is VPS. You can read more about VPS at http://support.hostgator.com/categories/linux-vps-virtuozzo

J Chow
I'm seeing this error and the amount allocated is 63176704 bytes (hit by Wordpress image upload script, image.php line 147). I'd like to utiliize my limit of 67108864 but before I fill out a support ticket, isn't 63176704 bytes a somewhat arbitrary-looking value? Would a php.ini containing 'memory_limit = 64M' even help me in this case?

HostGator
Sure, increasing the limit to the maximum 64MB will work because your 63176704 bytes is not the maximum.

You don't need a ticket to try this. You can create and edit your own php.ini file. Also, you can call us or join live chat to have an agent fix this immediately.

Nick Hughes
I am disappointed in the fact that 64MB is a inflexible limit for HostGator. I do not wish to pay 19.99 a month for a host when I can move to a competitor and have much more lenience.

I am being presented with this error when I am trying to run an install for SugarCRM. The CRM itself does not use this much memory but because I am unable to install my package I believe I will have to find a different host.

Can HostGator allow a memory change in order to install the package and once the package has been completed, then move the php.ini memory limit back down to its 64MB limit?

HostGator
Please email support@hostgator.com so we can help you.

Graham
These errors may be caused by errors in scripts, more likely - It's not often you'll exceed 64MB on a server, unless you're processing a lot of images .

HostGator
Thank you for your comments. Just a quick reminder that the comments on this page are not monitored by technical support staff, and that for support issues, it is best to contact us by live chat, phone or email so we can assist you right away.

Although comments are not monitored by technical support staff, they are moderated and read by technical writers. Comments will need to be approved by a moderator before appearing.

Our technical writers do read the comments periodically for the purposes of updating the articles, and do appreciate your feedback, suggestions and corrections to the articles themselves, as well as any suggestions or tips for readers of this article. However, support questions posted here are not guaranteed to be replied to in a timely manner or at all. For support issues, it is best to contact our support staff instead by live chat, email or phone.



Your comments help us keep the knowledge base updated. This is not a medium for support. If you have questions or need help, please contact us via email, phone or live chat for fast assistance.

Post Comment