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?

Login to comment.

Your Opinion Matters

... but we need to know what you're thinking!

The Community Support team wrote the article you're looking at now. We like to think it's perfect, but we're sure you have some suggestions. Please, let us know what they are!

Feedback
Your Email Address
Because we'd like to talk with you!

Have a Question?

If you need some help, submit your question to our Community! We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)

Recent Questions

  1. Email from unknown party re domain transfer
  2. how to make new website with single account.
  3. Internal Server Error

Support 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.