Knowledgebase: PHP / Programming
How to Run PHP without Timeouts
Posted by Tony B. on 30 April 2020 11:35 PM

We do not recommend you run PHP without web server timeouts on web requests but instead if you need a long running PHP process you run it from a cron job or from SSH if it's a one time operation. There however may be cases such as Wordpress plugins where it must be ran by visiting a URI. You can disable web server PHP timeouts by doing the following:

To disable all timeouts you can add the following to your .htaccess file:

<IfModule Litespeed> 
SetEnv noabort 1
</IfModule>

If you wish to only have no timeouts for certain requests such as for example wp-cron, backupbuddy or importbuddy you could use the following:

RewriteEngine On
RewriteRule (wp-cron|backupbuddy|importbuddy)\.php - [E=noabort:1]

Keep in mind you may also need to modify the PHP max_execution time if your application does not modify this for you.

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).