How to increase PHP max_execution_time WordPress site

  1. To max_execution_time Locate the php.ini file: This file is responsible for setting up the PHP configuration. You can ask your web hosting provider to know the location of this file. Alternatively, you can use a tool like File Manager or FTP FileZilla to access the files on your server.
  2. Access the php.ini file using File Manager: If your web hosting provider offers a File Manager, log in to your hosting account and navigate to the File Manager. Look for the php.ini file, which is typically located in the root directory of your server. Right-click on the file and select “Edit” to open it in a text editor.
  3. Access the php.ini file using FTP FileZilla: If you prefer to use an FTP client like FileZilla, download and install it on your computer. Once installed, open FileZilla and enter your FTP credentials to connect to your server. Navigate to the root directory of your server and look for the php.ini file. Right-click on the file and select “Edit” to open it in a text editor.
  4. Find the max_execution_time setting: Search for max_execution_time in the php.ini file. If it is not there, you can add it manually. The line should look like this:

[php]max_execution_time = 300[/php]

The value of 300 is the time in seconds that the script is allowed to run before it is terminated.

  1. Save and close the php.ini file.
  2. Access the wp-config.php file: The wp-config.php file contains important configuration information for your WordPress site, including database connection details. To access it, you can use File Manager or FTP FileZilla.
  3. Access the wp-config.php file using File Manager: Log in to your hosting account and navigate to the File Manager. Look for the root directory of your WordPress site, and locate the wp-config.php file. Right-click on the file and select “Edit” to open it in a text editor.
  4. Access the wp-config.php file using FTP FileZilla: Connect to your server using FTP FileZilla, and navigate to the root directory of your WordPress site. Look for the wp-config.php file and right-click on it. Select “View/Edit” to open the file in a text editor.
  5. Add the set_time_limit code: Once you have opened the wp-config.php file in a text editor, add the following code:

[php]set_time_limit(300);[/php]

This will set the maximum execution time to 300 seconds. Add it after the line that reads:

[php]/* That’s all, stop editing! Happy blogging. */[/php]

  1. Save and close the wp-config.php file.
  2. Verify the change: To check if the change has taken effect, you can create a phpinfo.php file in your WordPress site’s root directory with the following code:

[php]<?php phpinfo(); ?>[/php]

Visit the phpinfo.php file in your web browser and look for the max_execution_time setting. It should now display the new value that you have set.

Note: Always make a backup of any file you are editing before making any changes to avoid losing any important data.