Skip to main content
PHP’s max_execution_time limits how long a script may run before the server stops it (default is typically 30 seconds). Long-running tasks — large imports, backups, migrations — sometimes need more.

Method 1: MultiPHP INI Editor

  1. Log in to cPanel.
  2. In the Software section, click MultiPHP INI Editor.
  3. Select your domain.
  4. In Basic Mode, find max_execution_time and enter a higher value (e.g. 300 for five minutes).
  5. Click Apply.

Method 2: PHP Selector options

If your server uses the CloudLinux PHP Selector:
  1. In cPanel, click Select PHP VersionOptions.
  2. Find max_execution_time and set the value.

Method 3: .htaccess

On servers where PHP runs in a mode that allows it, you can add this to your .htaccess:
If adding php_value lines to .htaccess causes a 500 error, your PHP handler doesn’t accept them — remove the line and use Method 1 or 2 instead.

Method 4: In the script

For a single script:
Long-running tasks often hit other limits at the same time. Consider raising these too:
  • memory_limit — memory available to the script (e.g. 256M)
  • upload_max_filesize and post_max_size — for large file uploads
  • max_input_time — time allowed to parse input data
Raise limits to what the task genuinely needs, not to extreme values. A script that needs 30+ minutes is usually better run as a cron job or from the command line over SSH, where web-request time limits don’t apply.