WordPress has become memory Hungry

WordPress has become a powerful CMS thanks to the many great plugins available. But with so much modification to the WordPress Core, you may have experienced errors appearing saying that there is not enough memory. In this tutorial We will create a php.ini file that can increase your PHP memory limit and allow wordpress to be as powerful as you want.

How do I feed WordPress some more PHP memory?

By default your PHP memory limit will be set to 32M. You may also notice that your wordpress errors have a similar number, what this means is wordpress has 32M to work will, but your plugins are asking it to do too much and it needs more than 32M. We can increase this memory limit to 64M which will be more than enough. We do this by editing our php.ini file.

Step 1: Contact your hosting service

Before you go and start editing files, stop and do your research. We don’t want to accidental send our website into down time. Contact your hosting service and either send them a ticket or give them a call. You want to ask them how you can increase your PHP memory Limit. If you lucky, your host will change it for you. If your not so lucky, follow the steps below to increase the amount manualy.

Step 2: editing .htaccess file

You can find you .htaccess file in your public_html folder on your server. If the file isn’t there, it may just be hidden. If its not hidden, you may have to chat to your host about where it is. Open up your .htaccess file and add this line of code:

suPHP_ConfigPath /home/username/public_html/

Where “username” is your CPanel username. That tells your php script to look for a PHP configuration file in this folder. Now lets make a PHP configuration file for it to use.

Step 3: Create a php.ini file

create a file called php.ini and place it your public_html folder on your website (This is the root directory where your website sits). If you already have a php.ini file thats great.  Open your php.ini file and add this code:

memory_limit = 64M ;

Step 4: wp-config

You may also need to tell WorPress to use 64M or memory. To do this, open up your wp-config.php file and add this line of code:

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

Problem Solved!

Now your WordPress memory errors should be fixed! Good luck. If this tutorial was helpful please leave a reply and let me know how it went.