Not enough memory

Sometimes after activating a plugin the admin side is blank with a memory error message, sometimes the front page too. The standard fix is to increase the memory in config.php.

What is the best way to prevent in advance all or most memory problems to occur ?

2 Answers
2

Using FTP, try increasing the memory for PHP and WordPress by editing the memory_limit line in your php.ini (if you have access to it) to 64M or 128M, which should be fine for non-multisite installs.

memory_limit = 64M;

If you can’t get to the php.ini file, add this line at the top of your .htaccess file:

php_value memory_limit 64M

If that doesn’t work or throws an error, add this line near the top of your wp-config.php file right after the opening <?php

define('WP_MEMORY_LIMIT', '64M');

But your host may limit changes to .htaccess in your account and to the host-wide php.ini, so these may not work. if not, ask your host.

You can run phpinfo to see what kind of memory allocation you already have. Make a plain text file and call it phpinfo.php and put just this line in it:

<?php phpinfo(); ?>

then put the file in the root of your server, and then go to that file with your web browser. You’l see all the php info you need; scroll down for memory settings. If you get an error, that means your server company won’t allow phpinfo to run for security reasons.

Leave a Comment