Increasing the PHP Memory

You are here:
Estimated reading time: 1 min

About this Article

If you run a web application (for example WordPress) and you’re seeing memory exhausted errors, this article describes how to correct this.

What Does the Error Mean?

This is often down to PHP Memory Limit. If the memory the script is trying to use is greater than the limit set then you will see this error.

How to Correct This Error

You can change this in your web hosting panel. Here’s how:

  1. Login to cPanel Control Panel
  2. Scroll to the Software Section
  3. Select Select PHP Version
  4. Click the Switch to PHP Options link on the right
  5. Look for memory_limit in the list. You will find this is probably set to 64M or 128M
  6. Click on the current value and select a new one. 256M should do it. If you do select any higher, it won’t matter as the server is configured to only allow a max of 256M
  7. Click Apply. Click Save at the bottom of the screen
  8. Job done

An Alternative Approach for WordPress

If you are using WordPress, you can also set this by adding the following to your wp-config.php file:

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

That should fix it. If not, please submit a ticket and we’ll take a closer look for you.

Was this article helpful?
Dislike 0
Views: 22