Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Though I've been using my website's dashboard the last few days without installing any plugin nor touching any piece of code, today my dashboard (but not my website) is unavailable with a message "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home/.../public_html/mysite.com/wp-includes/class-wp-admin-bar.php on line 36".

The define('WP_MEMORY_LIMIT', '64M'); was already present in wp-config.php.

Considering that I haven't touched anything, what could be the cause and how to fix it?

share|improve this question
    
33554432 Bytes is only 32MBs. If this is Multisite, that isn't enough, and even if it isn't that is pretty thin memory. –  s_ha_dum Dec 8 '12 at 1:23
    
I edited to include the complete error message. I'm not sure what you mean by "multisite". I have many websites on this server, but this WordPress website in particular is only one site, although it comes in 3 languages. –  drake035 Dec 8 '12 at 10:52
add comment

1 Answer 1

up vote 0 down vote accepted

(1) edit wp-settings.php [32M to 64M]

(2) Try adding this line to your wp-config.php file: define('WP_MEMORY_LIMIT', '64M'); (you already have this, therefore ignore this step)

(3) If you have access to your PHP.ini file, change the line in PHP.ini If your line shows 32M try 64M: memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)

(4) If you don't have access to PHP.ini try adding this to an .htaccess file: php_value memory_limit 64M

(5) Enable a custom PHP config

In order to enable the use of php.ini, you simply need to upload a php.ini file into the directory which requires further PHP configuration options.

Create a php.ini file in your public_html/ folder with whatever directives you want to control, and your application will be using those updated settings.

If you want some specific application directory to have it’s own php.ini which might differ from the main website php.ini – then upload it into the directory in question.

(6) Make your php.ini global for your hosting account

You might want all your subdirectories and Addon domains to use the same php.ini configuration. To avoid having to create the php.ini in every folder which requires it, you can specify a global PHP configuration path for your virtual host using the .htaccess file. To do this:

Modify or create the file called .htaccess inside your public_html/ folder Add the following code to the start of the .htaccess file: suPHP_ConfigPath /home/USERNAME/public_html/ …where the “USERNAME” is your cPanel username.

Please note that this step is server specific.

(7) Talk to your host.

share|improve this answer
    
I don't understand the 1st step, "edit wp-settings.php [32M to 64M]". If you mean adding "define('WP_MEMORY_LIMIT', '64M');" to wp-settings.php, I tried to no avail. If you mean searching "32m" in wp-settings.php and replace it by "64m", I didn't find any "32" in this file. I tried (4) as well (by adding "php_value memory_limit 64M" between "</IfModule>" and "# END WordPress" in .htaccess) and got a Internal Server Error on my entire site. –  drake035 Dec 9 '12 at 13:19
    
From phpinfo() please check the present memory_limit set there. Create a php file with <?php phpinfo(); ?> and check the memory_limit. If it is at 32M then please ask your host to increase it to 64M. –  gurudeb Dec 9 '12 at 15:22
    
I got: "Warning: phpinfo() has been disabled for security reasons in /home/.../public_html/mysite.com/phpinfo.php on line 1" –  drake035 Dec 9 '12 at 23:17
    
Please contact your host. They can increase the memory_limit settings. –  gurudeb Dec 10 '12 at 17:41
    
They did and it works now. They explained me how to create my own php.ini on their server. –  drake035 Dec 13 '12 at 23:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.