> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Changing the PHP max_execution_time directive

> Learn to adjust PHP script execution time using the max_execution_time directive in php.ini with this step-by-step guide.

This article describes how to change the maximum execution time for PHP scripts by using the **max\_execution\_time** directive in a *php.ini* file.

<Warning>
  **Important**

  The information in this article only applies to certain types of hosting accounts. To determine whether or not the information below applies to your account, please see [this article](/docs/changing-php-settings-and-versions).

  📘 Note

  This article assumes that you have already set up a custom *php.ini* file on your web site. If you have not already set up a custom *php.ini* file, please read [this article](/docs/custom-php-ini-files) first.
</Warning>

## Using PHP max\_execution\_time directive

By default, the maximum execution time for PHP scripts is set to 30 seconds. If a script runs for longer than 30 seconds, PHP stops the script and reports an error. You can control the amount of time PHP allows scripts to run by changing the **max\_execution\_time** directive in your *php.ini* file.

To change the maximum execution time, use a text editor to modify the **max\_execution\_time** directive in your *php.ini* file. For example, to set the maximum execution time to 10 seconds, use the following setting:

```
max_execution_time = 10
```

<Tip>
  To verify the current value of the **max\_execution\_time** directive and other directives, you can use the **phpinfo()** function. For more information, please see [this article](/docs/view-php-settings).
</Tip>

## More information

* To view a complete list of *php.ini* directives, please visit [http://www.php.net/manual/en/ini.list.php](http://www.php.net/manual/en/ini.list.php).

* For more information about the **max\_execution\_time** directive, please visit [http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time](http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time).

## Related articles

* [Custom php.ini files](/docs/custom-php-ini-files)

* [Using php.ini directives](/docs/using-php-ini-directives)
