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

What Does Latest OpenStack Ocata Bring for Us?
OpenStack now is still an on-going project, whose components are in different stability and mature phases. It also means enterprises are confronting OpenStack deployment challenges, especially in the terms of scalability and network. The new version of OpenStack brings something new to handle the issues found before.
Most Common Website Security Mistakes
There are several factors that the website developers need to take care of while designing and developing a dynamic website.
LiquidWeb Brings Innovation Back to Managed WordPress Hosting
LiquidWeb is not done with its managed WordPress hosting yet! Now it comes back to customers with new tools to help them visualize their site changes. A new visual comparison tool as well as automatic SSL is now included in LiquidWeb managed WordPress hosting plans, addressing customers’ demands and pain points very well.
Top 5 Qualities A Good WordPress Developer Has
Based on years of WordPress related services and products reviewing, we conclude 5 top qualities that a good WordPress developer should have!
Confirmed! Microsoft Spring Launch is in New York City on May 2
Microsoft spring even has been the host discussion for several weeks, and this Wednesday Microsoft began to send out official invites via email to analysts, press, and the other guests, meaning the final answer was confirmed that the hot Microsoft Spring Launch, the Microsoft EDU event will be on May 2 in New York City.
Be the first to comment!
About the author
Views: 213100
Articles: 93

Author's Hot Articles


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. »
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. »
Chat Advertising cooperation TOP