Different Ways Of Increasing PHP Memory Limit When Using WordPress

Increasing PHP limit is easy. The most popular method of increasing PHP limit is by editing the PHP.ini file which is present on your site’s root directory. But here are few more menthods you can use for increasing PHP memory limit in your WordPress site.

By Editing WordPress Configuration File:

If you are running a self hosted WordPress site and you have access to your site’s root directory (public_html) the simply open your wp-config.php file and add the following code editing 64M to the size of memory (MB) you like to increase:

define(‘WP_MEMORY_LIMIT’, ’64M’);

By Editing install.php File:

Install.php file is present in your wp-admin directory of WordPress. You can access it from your site’s root -> wp-admin folder -> install.php. Now add the following line:

ini_set(‘memory_limit’,’64M’);

By Editing .htaccess File:

You can simply open .htaccess file present in your site’s root directory and add the following line, you may increase the 64M to more:

php_value memory_limit 64M

By Editing php.ini File 

Simply add the following line by editing your site’s php.ini file present in your site’s root. Most WordPress installations doesn’t have this file, you can easily create one and add the code:

memory_limit = 64M

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.