InMotion Hosting Support Center

A common error with Open Source Software like WordPress, Moodle, and Joomla is the php "Allowed memory size error." Increasing the memory limit is an easy solution. This memory_limit can be changed in the php.ini in the public_html folder in your hosting account. This error can creep up in your website during the normal development process. The following is an example of the error:

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

This is due to php variable data being stored in the memory that is not cleared while the php scripts are running.

For those who code their own sites: Coders use the unset() function to clear variable data that is no longer needed; however, with open source software, you will not want to alter any code.

How to fix the "Allowed memory size Error"

The php memory resource can be increased in the php.ini located in the public_html. The following steps will explain how to set the php.ini to allow a larger amount of memory use.

  1. Login to your cPanel
  2. Go to the File Manager.

    Select the Web root (public_html/www) directory and click Go.

  3. Find the php.ini file in the public_html.

    Note! If you do not have a php.ini in your public_html files, you can have our tech support staff restore the php.ini to your public_html directory.

    Open the php.ini with the code editor.

  4. Find the following section in the php.ini file.

    max_execution_time = 30
    max_input_time = 60
    memory_limit = 128M

    Try increase the memory_limit value to 256M.

    If the php memory_limit is already at 256M, you can increase it to 512M.

    Save the changes.

  5. In order for your memory limit to take effect you will need to make the php.ini recursive.

    Important! Making the php.ini recursive is an important step. If you do not know how to do this, please see our article on Make the php.ini recursive in the .htaccess.

    Now visit the site. You should not see the "Allowed memory size" error anymore. If the error still shows on your website, there may be a setting within the software itself that is overriding the change or the php.ini in the public-html may be overriden by another setting elsewhere. If this is the case, you can contact our our tech support staff to have them look into the error further.

Support Center Login

Social Media Login

Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Our site is down
Wordpress Multisite Goes White Blank on Login
Fatal error: Allowed memory size of 67108864 in Open Cart
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
2013-11-25 12:34 am
Hi. I have problem about memory limit. "Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 578 bytes) in /home/............... /admin/model/tool/export.php on line 352" appeared at my website when i import file import/export. I already changed memory_limit from 240M to 512M but still cannot add more option product.
11,186 Points
2013-11-25 9:46 am
As this is deep within your file structue, be sure that your php.ini is set to be recursive. You may see more information on this at the following:

Make the php.ini recursive in the .htaccess
n/a Points
2014-11-12 1:53 am

Thanks for your description of the solution to this problem. I've read a lot of explanations of how to fix this and this was the best and it worked, in part because of your admonition to make the php.ini recursive. As it happens this also solved the "white screen of death" WP editing screen problem I was having. It turns out that was, at least for me, a memory problem, contrary to what a lot of people were saying elsewhere. So a big thank you!

n/a Points
2014-12-22 12:53 pm

I agree, very helpful article, thanks so much for sharing

n/a Points
2015-06-05 2:04 am

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 877375 bytes) in /www/htdocs/w0132262/wp-content/themes/thesis/lib/core/api/colors.php on line 206

31,565 Points
2015-06-05 9:55 am
Hello Vimal,

Did you follow the instructions above for how to fix the error? If so, what did you set the memory to? Have you tried increasing it to a higher limit?

Kindest Regards,
Scott M
n/a Points
2015-08-11 11:33 pm

Hi,In the file wamp\alias\phpmyadmin.conf just before </Directory> insert four lines below to obtain:

  php_admin_value upload_max_filesize 512M
  php_admin_value post_max_size 512M
  php_admin_value max_execution_time 720
  php_admin_value max_input_time 720

With this, I managed to import large SQL files. The largest file I actually imported was 278 MB

28,417 Points
2015-08-12 9:28 am
Hello Imran,

If you're running WAMP, then it's not running on our servers. We can try to give you some information, but you will need to look into memory consumption, current load on your server, etc in order to determine what's causing the program to fail due to memory exhaustion. You may require more memory on the computer that you're using a server.

I know you said that the largest file you imported was 278 MB, but the problem is the amount of memory your server is using at the time that you get the memory exhaustion error. You may need to also increase the MEMORY_LIMIT value which you don't show in your comment above.

I hope this helps to answer your question, please let us know if you require any further assistance.

Arnel C.
n/a Points
2015-09-13 3:14 pm

I have this error can anyone help? My php memory limit is already at 512MB.


PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 30 bytes) in /var/www/html/admin/libraries/BMO/DialplanHooks.class.php on line 0
31,565 Points
2015-09-21 1:37 pm
Hello Andy,

Have you tried increasing it just a bit more?

Kindest Regards,
Scott M
n/a Points
2015-09-17 1:05 pm


i have this problem but if i change this numbers, only a few of my files on my website, even if i increase my memory, and it are just exel files 

19,794 Points
2015-09-17 5:50 pm
Hello Tom,

Thank you for contacting us. Make sure you are making the file recursive, as explained in Step 5 above. This allows the rule change to affect the child folders as well.

A phpinfo page can help determine if the change was made.

If this does not help, let us know the full errors you are getting.

Thank you,
n/a Points
2015-09-23 1:02 am

Dear Team

We are running a script of facebook sdk in one of our server and that is always giving an error of memory that is mentioned below :


Click on this URL and refresh it :

Errors is below :

helloFatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 1145367209 bytes) in /home/websocialite/public_html/facebookwebs/src/facebook-sdk-v5/autoload.php on line 80

We have run the similar script on other servers also and there it is running...

Other server links are :


We know that it is coming due to some server settings in whm, please suggest us for the linux server settings for this issue. It is very urgent...

28,417 Points
2015-09-23 2:29 pm
Hello Brahm Pratap Rana,

Sorry for the problem with the SDK. The error you're showing indicates it's running on a Godaddy server (with whom we are not associated). However, you may want to try changing the php.ini file that is local to that domain on your web server. The steps described above would be what you need to make that change (most likely to memory limit). In addition, you may want to make the php.ini file recursive using the .htaccess setting for the domain. If you don't have a PHP.INI file then you may want create one or speak with your host's tech support to obtain one.

I hope this helps to answer your question, please let us know if you require any further assistance.

Arnel C.
n/a Points
2015-09-24 12:36 am

Dear Arnel

I would like to inform you that this is not Godaddy Server, it is dedicated server which we are managing from our end and if we increase the memory limit thru whm panel then it again says to increase more, I mean to say that it again and again after each refresh of the page ask us to  increase the memory like this way i.e (tried to allocate 1145367209 bytes).

So kindly confirm us if we will make the php.ini file recursive then this error will not come.?

Also confirm us that our server administrator could make the php.ini file recursive or any programmer will make it??


Waiting for your urgent reply please and thanks for your support.. 


31,565 Points
2015-09-24 9:09 am
Hello Brahm,

If you are using Apache server then making the php.ini recursive can be done by anyone who has access to the cPanel. We have an article on how to make php.ini recursive here.

Kindest Regards,
Scott M

Post a Comment

Email Address:
Phone Number:

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

21 Questions & Comments

Post a comment

Back to first comment | top

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!