1. Home
  2. How To
  3. Dedicated Server
  4. Wordpress Installation
  5. How To Modify WordPress PHP Memory Limit

How To Modify WordPress PHP Memory Limit

Objectives

Increase the WordPress PHP memory limit to handle larger workloads

Prerequisites

None

Steps

Step 1: Modify default-constants.php

You would need to access the console of your web server. Then, edit the file called default-constants.php

nano /home/beautifulnara/public_html/wp-includes/default-constants.php

Go to the line the writes WP_MAX_MEMORY LIMIT

Then, under the else condition, change the value from 256M (default) to 1024M.
For example,

define( ‘WP_MAX_MEMORY_LIMIT’, ‘1024M’ );

To verify, there will be a noticeable change upon navigating from an option to another within the WordPress backend.

Step 2: Configure PHP-FPM

Next, some modification are to be done on your WHM (Web Host Manager). Once you have logged in, navigate to Home > Software > MultiPHP Manager.

Before adding the values in, ensure you have calculated the remaining free memory in your server which can be allocated for PHP-FPM.

In our case, the new values for the PHP-FPM Pool Option will be: –

Max Requests: 300
Process Idle Timeout: 10
Max Children: 100

At the searchbar on left pane, type php.

Select PHP-FPM service for Apache, and then hit Yes.

Updated on July 6, 2020

Was this article helpful?

Related Articles

Need Help?
Submit a ticket to us and let our professional team assists you

Support Billing Sales
Support
Billing
Sales