When working with php programs on your hosting server, you will inevitably run into errors. One of the more common errors is the "Allowed memory size" error. This error simply means that the program needs to have more memory allotted to it. Below is an example of the error:

Fatal error: Allowed memory size of 32673223 bytes exhausted (tried to allocate 280559520) in Unknown on line 0

To fix the error, we will need to increase the allowe memory in your php.ini file. This is found in your hosting account folders. Below are the instructions to guide you on how to fix the php memory error in your php.ini file.

Fixing the "Allowed memory size" error

  1. First, log into your cPanel dashboard.
  2. Now that you are in the main cPanel area, find and enter the web root using the File Manager.
  3. Locate the php.ini file in your public_html folder. If you do not have one, our Live Support team can place a default one in your account, or you can create a blank file by clicking on the New File icon and naming it php.ini so you can edit and add your own settings. Once you have a php.ini file, open it for editing.
  4. Inside the php.ini code editor, look for the line below:

    memory_limit = 128M

    Once you find the code line, you can increase the memory limit. It is customary to double the amount that is currently in the setting. (32M to 64M, 128M to 256M, etc) You can always increase it more if you need to.
  5. Once the change has been made, click the Save Changes button. This will enable your new memory allotment setting.
  6. Finally, to ensure the setting is activated for all files and folders on your account, make sure the php.ini file is recursive.

If you have set the memory limit as high as 512M and are still getting the error, it is possible the program you are using has some sort of override for this setting. In that case, please contact our Live Support team and they will be happy to look into the issue further. 

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Did you find this article helpful?

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

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

Not a Customer?

Get web hosting from a company that is here to help.