These are super quick and easy!

Why would you want to increase your Memory Limit? Well, everything runs much smoother of course and when a script is being run it has more room to move.

But the main reason I found myself doing this is because of an error.  Have you ever seen this error before (below)?

Fatal Error - failed to allocate memory...

Yep, so have I!

This error flashes up often due to a lack of memory for your WordPress site to use.  You typically get around 32Mb when you install WordPress, but I run mine at about 128Mb.  This is how you do it!

Create a ‘Php.ini’ file

Using a text editor, save a file called php.ini (make certain there’s no ‘.txt.’ on the end).

This can be done on Windows with Notepad. If you’re using windows, simply open up notepad (Run – type notepad), go to File -> Save As. Under file type, choose all files and then simply save the file as php.ini.

After that, insert the following line of code:

memory_limit = 128M ;

Save the file and you’re php.ini file is ready for upload!

Upload the file to your root directory

So using your FTP program (I like CoreFTP, it’s a free and easy to use program), find your root directory – which is the directory which contains your ‘wp-content‘ and ‘wp-admin‘ folders, etc.

Then simply upload the file to that directory and you’re done!  Every folder and file under the ‘root’ directory should run with the added memory.

If you don’t have access to your FTP (or are simply not familiar with it), you can go through the file manager on your web hosting control panel and upload it that way.

If  you go to upload and the file already exists, simply download it and add the code mentioned above – then re-upload and replace.

Quick and dead simple! I do it on all of my websites, so I hope you find it useful! 

If that doesn’t work, here’s something else.

Use your FTP program or file manager to download your wp-config.php file. Open in a text editor, then insert this line in the page somewhere:

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

Then re upload and overwrite!

 There’s Still One More!

So this final little trick is to search for your .htaccess file in your root directory. Simply download and add the following code:

php_value memory_limit 128M

Then re upload and overwrite just like the methods above.

You should be set!

These work on the majority of hosts out there, but if for some reason you still get errors then contact your hosting company and tell them about your problem. Also, you can check your plugins and themes – most mainstream plugins and themes won’t cause troubles but you may need to remove something to ‘unclog’ your WordPress operations a little.

Thanks for reading.  Remember to subscribe below if you found this useful!

Related Posts for WordPress Advice & Tutorials