How to Increase PHP Memory Limit for WordPress

Well, if you see below error when using WordPress, which means you need to increase the memory limit for WordPress. Fatal Error: Allowed memory size of xxxxxx bytes exhausted

As a CMS written using PHP, the memory of WordPress could use in each request is limited by PHP memory_limit. The minimal value to run WordPress smoothly is 32MB, however, if you install a lot of plugins or insert large image in your blog, then you need to increase this value to 64MB or even 128MB.

You could refer to How to Increase PHP Memory Limit to know how to increase it at system level. And in below, we will share some simple ways, via which you only need to modify the configuration of WordPress and then increase PHP memory limit at running time.

Altering PHP Memory Limit via wp-config.php

For this method you won't have to create any extra files in your directory.  Add the following code (below) to your wp-config.php file to increase your PHP Memory Limit to 64MB.

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

Changing PHP Memory Limit via install.php

This way is also very simple, all you need to do is to modify install.php file and place the following code to it:

ini_set('memory_limit', '32M');

install.php file is located in wp-admin folder.

Fail to Increase PHP Memory Limit for WordPress

This is possible since your Web Host might limit the maximal PHP memory_limit at system level so that your modification during running time might fail. In this case, contact your web host and ask for the change, or you need to find a new WordPress hosting solution which allows for larger PHP memory limit.

Tagged with:

Related Articles

GoDaddy Unveils Business Hosting to Expand Its Service Portfolio
03/16
On Tuesday, 14th March 2017, GoDaddy had announced the launch of a new Business Hosting platform that will be available for the users with shared hosting. With this launch, GoDaddy wishes to offer easier services to the users who have been using shared hosting.
WP Engine Helps WordPress Users Upgrade to PHP 7
03/07
WP Engine has recently declared that they will help the users of the WordPress to help adopt the PHP 7. This environment will be offered by the WP Engine to all the users and customers. It will also be offered to the PHP 7 Compatibility Checker plugin. This plugin was launched by the WP Engine a few months ago.
Microsoft Officially Extends SQL Server and Windows Server Support by 6 Years
03/03
The additional 6 years of Windows Server Premium Assurance as well as SQL Server Premium Assurance now is added to Microsoft server products. From now on, both assurance services at Microsoft will come with total 16 years of support, so as to keep users secure.
5 Brilliant Ideas for Holiday Email Marketing
12/16
With a growing number of people buying online, making a solid email marketing plan can help take advantage of this trend and bring you with merry and bright holiday sales.
How to use Amazon S3 and CloudFront CDN for WordPress
12/16
AWS (Amazon Web Services) have managed to leave their impact in the field of cloud computing specifically because their s3 and cloud front services. Amazon s3 and CloudFront plug-in helps to implement these services quickly.
Comment
Be the first to comment!
About the author
Views: 201583
Articles: 93

Author's Hot Articles

godaddy
hub

Hot Posts

Service Recommendation

Cloud Hosting
Cloud hosting is the fastest growing hosting solutions in the industry. »
Cloud Storage
Best Cloud Storage are named based on customer and expert reviews. »
SSL
The most popular SSL certificate providers in the industry are here. »
China Web Hosting
Find out a comprehensive evaluation to the host service provider in China. »
bluehost
Chat Advertising cooperation TOP