Skip to main content

How to Increase the PHP Maximum Execution Time for One Website

You can increase the PHP Maximum Execution Time to allow scripts to run for a longer period before being timed out by the server. This is performed by a customer for a specific website within their hosting account.

You can increase the PHP Maximum Execution Time to allow scripts to run for a longer period before being timed out by the server. This is performed by a customer for a specific website within their hosting account.

Before you begin

You will need:

  • Access to your Hostek hosting control panel.

  • The specific website's information (such as the domain or account name).

Increase the PHP Maximum Execution Time

Depending on your hosting environment, you can adjust this setting using a configuration file or through your hosting control panel.

Using a .user.ini or php.ini file

If your hosting environment supports local configuration files, you can override the global limit for a specific website.

  1. Log in to your hosting control panel.

  2. Open the File Manager for the specific website.

  3. Navigate to the root directory of the website.

  4. Locate the .user.ini file (or php.ini if .user.ini is not present). If the file does not exist, create a new file named .user.ini.

  5. Edit the file and add or update the following line:

    max_execution_time = 300

    Replace 300 with your desired number of seconds.

  6. Save the file.

Using the Hosting Control Panel

If your account provides a graphical interface for PHP settings, you can modify the value directly.

  1. Log in to your hosting control panel.

  2. Locate the section for PHP Settings or PHP Configuration for the specific website.

  3. Find the row labeled max_execution_time.

  4. Change the value to your desired number of seconds (e.g., 300).

  5. Click Save or Apply.

Confirm the result

To verify that the change has been applied, you can check the active PHP configuration for that specific website.

  • Create a file named info.php in your website's root directory.

  • Add the following code to the file:

    <?php phpinfo(); ?>

  • Visit the file in your browser (e.g., https://example.com/info.php).

  • Locate the max_execution_time row in the table to confirm it reflects your new value.

  • Warning: Delete the info.php file from your server immediately after checking, as it reveals sensitive server information.

Limitations

  • The maximum value allowed may be restricted by the specific hosting plan or server limits.

  • Changes made via .user.ini or php.ini may require a restart of the PHP service or a cache clear to take effect, depending on your specific environment.

  • Increasing this value significantly can impact server resources; only increase it to the amount necessary for your specific script to complete.

Did this answer your question?