Can’t Install WordPress Plugins: Increase Memory Limit

On some servers sometimes I can’t install or update plugins. It’s really ugly, I like wp mainly because of its automatic updates. Besides regular problems with file permissions, there are other problems. On one server I had to change the FTP service to another mode, to enable uploads, etc.

Today I had a problem with the memory limit of a hosting account. Plugins didn’t load, when tried to install a plugin the page didn’t finish loading. So after searching I found a hint here. The fix presented there probably worked for wp 2.8. But as I didn’t find this code in my file, I had to do more research.

So, the solution to increasing the wp memory limit is to open a file called default-constants.php inside /wp-includes/ and look into line 18:

// set memory limits
	if ( !defined('WP_MEMORY_LIMIT') ) {
		if( is_multisite() ) {
			define('WP_MEMORY_LIMIT', '64M');
		} else {
			define('WP_MEMORY_LIMIT', '32M');
		}
	}

Changing 32M to 64M did the trick for me. Now plugins are installed and update works fine on this host.

Share:
This entry was posted in WordPress and tagged . Bookmark the permalink.

2 Responses to Can’t Install WordPress Plugins: Increase Memory Limit

  1. Magdelina says:

    Thank you so much for this aicrtle, it saved me time!

  2. Leandro says:

    Wonderful posting. Definitely thought provoking stuff, thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *