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

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.
Pros and Cons of Hybrid CDNs
12/16
Implementation of hybrid involves a number of advantages and risks too. Here we present various advantages of Hybrid CDNs along with the risks involved in them.
Importance of a CDN for your WordPress Blog
09/27
Using CDN for wordpress blog can improve various aspects of the including its speed. Find out more information below.
How Your Domain Name Will Impact Seo & Social Media Marketing
09/26
Selecting a domain name is one of the most imperative decisions that you make. Here are some factors that say how important is your domain name for SEO and SMM.
Comment
Be the first to comment!
About the author
Views: 196157
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