Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 122880 bytes)

Tags:

I have two domains, webhosted on 000webhost. I installed wordpress on them and for some days it functioned well, but now it shows me the following error on both of them:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 122880 bytes)

The source of the error ("in...") is never the same (it always changes).

I found that this error is common, but here I don't have a php.ini file. I understood that I should change the wp-config file. Well, here's the catch: how should I do this? I understood that I should add

define (‘WP_MEMORY_LIMIT’, ‘...M’); // increase limit to ..M" (adding 64, 96 or 128)  

[thanks to http://www.dummies.com/how-to/content/optimizing-the-wordpress-configuration-file.html]

I'm not good at programming (just a newbie who wants his own domain), can you help me? Please there me EXACTLY where to put the function. If this is not how to solve the problem, please offer me another solution. I am quite in a great need of help :)

I can't post the file here (it seems I don't format it well), but I can explain the structure:

  1. introduction: "* The base configurations of the WordPress. [...]
  2. After that, MySQL data.
  3. Then, "Authentication Unique Keys and Salts."
  4. "WordPress Database Table prefix"
  5. "WordPress Localized Language, defaults to English"
  6. "For developers: WordPress debugging mode"
  7. " That's all, stop editing! Happy blogging."

So, where should I introduce the define function (if in this file, where?), if in another, which and where?

like image 935
tudorvisanmiu Avatar asked Jul 23 '13 18:07

tudorvisanmiu


People also ask

How do I fix fatal error allowed memory size?

Fix error allowed memory size WP with WHMLog in to WHM. Go to "MultiPHP INI Editor". If you have multiple PHP versions on the server, set the one that is responsible for the problem with your Wordpress website. Scroll down where it says "memory_limit" and immediately make it 256M or even 512M.

How do I fix PHP fatal error allowed memory size 134217728 bytes exhausted?

Change the memory limit in the php. ini file and restart Apache. After the restart, run the phpinfo(); function from any PHP file for a memory_limit change confirmation. Memory limit -1 means there is no memory limit set.


1 Answers

For 000webhost, you should be able to override php.ini values using a .htaccess file stored in your public_html.

I'm not sure what values they allow you to override, but to raise the memory limit to 128M (the standard, I presume it was lowered to 64M), try putting this in .htaccess;

php_value memory_limit 128M 
like image 161
Joachim Isaksson Avatar answered Oct 10 '22 02:10

Joachim Isaksson