{"id":485,"date":"2021-07-27T23:19:55","date_gmt":"2021-07-27T23:19:55","guid":{"rendered":"https:\/\/hoganhost.com.ng\/blog\/?p=485"},"modified":"2024-08-12T13:34:44","modified_gmt":"2024-08-12T12:34:44","slug":"request-timeout-500-internal-server-error-on-litespeed","status":"publish","type":"post","link":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/","title":{"rendered":"Request Timeout &#8211; 500 internal server error on Litespeed"},"content":{"rendered":"<h1><img fetchpriority=\"high\" decoding=\"async\" class=\" wp-image-488 aligncenter\" src=\"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1-300x150.png\" alt=\"\" width=\"434\" height=\"217\" srcset=\"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1-300x150.png 300w, https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png 318w\" sizes=\"(max-width: 434px) 100vw, 434px\" \/><\/h1>\n<h1 id=\"run_php_without_timeouts\" class=\"sectionedit1 page-header\">Run PHP without Timeouts<\/h1>\n<div class=\"level1\">\n<p>This covers how to set up LiteSpeed Web Server so that a long-running PHP script will not be interrupted before it has finished.<\/p>\n<\/div>\n<h1 id=\"reason\" class=\"sectionedit2 page-header\">Reason<\/h1>\n<div class=\"level1\">\n<p>Some PHP scripts need to run for long periods of time without interruption. Examples include WordPress modules such as BackupBuddy, ImportBuddy, or any other module that relies on a WordPress built-in cron job. Whenever a PHP application rebuilds MySQL indexes, the process may run for a long time.<\/p>\n<\/div>\n<h1 id=\"how-to_s\" class=\"sectionedit3 page-header\">How-To&#8217;s<\/h1>\n<div class=\"level1\">\n<p>Generally, allowing a PHP script to run forever is not desirable. Thus there are a number of features (in LSWS and built into PHP) that may prevent a PHP process from running long enough to finish. You may need to set up more than one of the following configurations to ensure your application works correctly.<\/p>\n<\/div>\n<h2 id=\"turn_off_aborting_for_a_broken_connection\" class=\"sectionedit4 page-header\">Turn off aborting for a broken connection<\/h2>\n<div class=\"level2\">\n<p>When a user closes a connection (by closing a window, for example), LSWS will abort processing that PHP script by killing the PHP process. This is to avoid wasting system resources and prevent certain types of DoS attacks.<\/p>\n<p>In some cases, though, it is preferable to not to abort the PHP script regardless of whether the connection has been closed. For example, WordPress built-in cron jobs start a background job by sending a request to\u00a0<code>wp-cron.php<\/code>\u00a0then immediately closing the connection without waiting for response. In order for the cron job to complete, though, the web server must keep the PHP engine running without interruption.<\/p>\n<p>With Apache mod_php, the ignore_user_abort setting allows a user to trigger a long-running process and then close the browser or navigate away from the page without killing the PHP\/MySQL process. This setting is not supported by LSWS (or any Apache suEXEC setup).<\/p>\n<p>Aborting for a broken connection can instead be turned off at the server level in LSWS&#8217;s WebAdmin console or by using LiteSpeed&#8217;s \u201cnoabort\u201d environment variable.<\/p>\n<\/div>\n<h3 id=\"globally_via_the_webadmin\" class=\"sectionedit5\">Globally via the WebAdmin<\/h3>\n<div class=\"level3\">\n<p>WebAdmin console &gt; Configuration &gt; Server &gt; General &gt; External Application Abort<\/p>\n<p>Set External Application Abort to \u201cNo Abort\u201d to stop all applications from aborting even when a connection has been broken.<\/p>\n<\/div>\n<h3 id=\"through_the_noabort_environment_variable\" class=\"sectionedit6\">Through the &#8220;noabort&#8221; environment variable<\/h3>\n<div class=\"level3\">\n<p>Aborting for a broken connection can be turned off by using the request-level \u201cnoabort\u201d environment variable. This can be done in a rewrite rule or using the SetEnv\/SetEnvIf directives. \u201cnoabort\u201d is a LiteSpeed-specific environment variable, so all the following rules should be placed in<\/p>\n<pre class=\"code\">&lt;IfModule Litespeed&gt; \r\n...\r\n &lt;\/IfModule&gt;<\/pre>\n<p>The\u00a0<code>[E=noabort:1]<\/code>\u00a0flag can be added to any rewrite rule. The rewrite rule can be in an Apache .htaccess file or vhost-level configuration file. The rewrite flag should usually be used for a single account only. If you need to do a server-level configuration that will apply to all accounts (though perhaps only for certain scripts), you should use the SetEnvIf directive.<\/p>\n<\/div>\n<h4 id=\"rewrite_rule_examples\">Rewrite rule examples:<\/h4>\n<div class=\"level4\">\n<ul class=\" fix-media-list-overlap\">\n<li class=\"level1\">\n<div class=\"li\">For all requests.<\/div>\n<\/li>\n<\/ul>\n<pre class=\"code\">RewriteEngine On\r\nRewriteRule .* - [E=noabort:1]<\/pre>\n<ul class=\" fix-media-list-overlap\">\n<li class=\"level1\">\n<div class=\"li\">For\u00a0<code>wp-cron.php<\/code>,\u00a0<code>backupbuddy.php,<\/code>\u00a0and\u00a0<code>importbuddy.php<\/code>\u00a0only.<\/div>\n<\/li>\n<\/ul>\n<pre class=\"code\">RewriteEngine On\r\nRewriteRule (wp-cron|backupbuddy|importbuddy)\\.php - [E=noabort:1]<\/pre>\n<\/div>\n<h4 id=\"setenv_setenvif_directive_examples\">SetEnv\/SetEnvIf directive examples:<\/h4>\n<div class=\"level4\">\n<ul class=\" fix-media-list-overlap\">\n<li class=\"level1\">\n<div class=\"li\">For all requests.<\/div>\n<\/li>\n<\/ul>\n<pre class=\"code\">SetEnv noabort 1<\/pre>\n<ul class=\" fix-media-list-overlap\">\n<li class=\"level1\">\n<div class=\"li\">For certain URIs (i.e.\u00a0<code>wp-cron.php<\/code>,\u00a0<code>backupbuddy.php,<\/code>\u00a0and\u00a0<code>importbuddy.php<\/code>).<\/div>\n<\/li>\n<\/ul>\n<pre class=\"code\">SetEnvIf Request_URI \"(wp-cron|backupbuddy|importbuddy)\\.php\" noabort<\/pre>\n<p><strong>Note:<\/strong>\u00a0Rewrite rules cannot be easily inherited. Thus, if you want to affect all accounts with one setting, the SetEnvIf directive should be used.<\/p>\n<\/div>\n<h2 id=\"litespeed_connection_timeout_override\" class=\"sectionedit7 page-header\">LiteSpeed connection timeout override<\/h2>\n<div class=\"level2\">\n<p>If a script does not send back anything for a long time, this can trigger a connection timeout and the server will close the client connection. This is done to prevent poorly written PHP scripts from tying up the server. To get desired functionality from your web applications, though, you may need to prevent the connection from being timed out. (If the \u201cnoabort\u201d environment variable above has been set, the script will continue to run even though the connection has been broken. Your application, though, may require the connection to stay open for correct functionality.)<\/p>\n<p>Connection timeout can be prevented by either increasing the global connection timeout setting (via the WebAdmin console) or using LiteSpeed&#8217;s \u201cnoconntimeout\u201d environment variable.<\/p>\n<\/div>\n<h3 id=\"globally_via_the_webadmin1\" class=\"sectionedit8\">Globally via the WebAdmin<\/h3>\n<div class=\"level3\">\n<p>WebAdmin CP &gt; Configuration &gt; Server &gt; Tuning &gt; Connection Timeout (secs)<\/p>\n<p>This setting can be increased to allow scripts to run longer (though they will still time out after the specified time has elapsed).<\/p>\n<p>If LiteSpeed ADC is running in front , ADC connection timeout also need to adjust.<\/p>\n<\/div>\n<h3 id=\"through_noconntimeout_environment_variable\" class=\"sectionedit9\">Through &#8220;noconntimeout&#8221; environment variable<\/h3>\n<div class=\"level3\">\n<p>Similarly to the \u201cnoabort\u201d environment variable, you can add the \u201cnoconntimeout\u201d environment variable via a rewrite rule or using the SetEnv\/SetEnvIf directives. (The rewrite flag is preferred for controlling a single account. The SetEnv\/SetEnvIf directives are preferred for rules that will apply to all accounts.) \u201cnoconntimeout\u201d is a LiteSpeed-specifc environment variable, so all the following examples should be placed inside:<\/p>\n<pre class=\"code\">&lt;IfModule Litespeed&gt; \r\n...\r\n&lt;\/IfModule&gt;<\/pre>\n<\/div>\n<h4 id=\"rewrite_rule_examples1\">Rewrite rule examples:<\/h4>\n<div class=\"level4\">\n<ul class=\" fix-media-list-overlap\">\n<li class=\"level1\">\n<div class=\"li\">For all requests. (In\u00a0<code>.htaccess)<\/code>\u00a0add<\/div>\n<\/li>\n<\/ul>\n<pre class=\"code\">RewriteEngine On\r\nRewriteRule .* - [E=noconntimeout:1]<\/pre>\n<ul class=\" fix-media-list-overlap\">\n<li class=\"level1\">\n<div class=\"li\">For\u00a0<code>wp-cron.php<\/code>,\u00a0<code>backupbuddy.php,<\/code>\u00a0and\u00a0<code>importbuddy.php<\/code>\u00a0only.<\/div>\n<\/li>\n<\/ul>\n<pre class=\"code\">RewriteRule (wp-cron|backupbuddy|importbuddy)\\.php - [E=noconntimeout:1]<\/pre>\n<ul class=\" fix-media-list-overlap\">\n<li class=\"level1\">\n<div class=\"li\">Combined with the \u201cnoabort\u201d environment variable.<\/div>\n<\/li>\n<\/ul>\n<pre class=\"code\">RewriteRule (wp-cron|backupbuddy|importbuddy)\\.php - [E=noabort:1, E=noconntimeout:1]<\/pre>\n<pre class=\"code\">SetEnvIf Request_URI \"(wp-cron|backupbuddy|importbuddy)\\.php\" noconntimeout<\/pre>\n<\/div>\n<h4 id=\"setenv_setenvif_directive_examples1\">SetEnv\/SetEnvIf directive examples:<\/h4>\n<div class=\"level4\">\n<ul class=\" fix-media-list-overlap\">\n<li class=\"level1\">\n<div class=\"li\">For certain URLs (i.e.\u00a0<code>wp-cron.php<\/code>,\u00a0<code>backupbuddy.php,<\/code>\u00a0and\u00a0<code>importbuddy.php<\/code>).<\/div>\n<\/li>\n<\/ul>\n<pre class=\"code\">SetEnvIf Request_URI \"(wp-cron|backupbuddy|importbuddy)\\.php\" noabort noconntimeout<\/pre>\n<\/div>\n<h2 id=\"lsapi_max_process_time_environment_variable\" class=\"sectionedit10 page-header\">&#8220;LSAPI_MAX_PROCESS_TIME&#8221; environment variable<\/h2>\n<div class=\"level2\">\n<p>In ProcessGroup mode, the\u00a0<a class=\"urlextern\" title=\"http:\/\/www.litespeedtech.com\/docs\/litespeed-sapi\/php-lsapi\/configuration\" href=\"http:\/\/www.litespeedtech.com\/docs\/litespeed-sapi\/php-lsapi\/configuration\" rel=\"nofollow\">&#8220;LSAPI_MAX_PROCESS_TIME&#8221; environment variable<\/a>\u00a0(default 3600 seconds) controls the maximum processing time allowed when processing a request. If a child process cannot finish processing the request in the given time period, it will be killed by the parent process. This option can get rid of a dead or a runaway child process.<\/p>\n<p>Set the environment variable in your external application settings (WebAdmin &gt; Configuration &gt; Server(or Vhost) &gt; External App &gt; your external application &gt; Environments).<\/p>\n<\/div>\n<h2 id=\"php_execution_time_in_phpini\" class=\"sectionedit11 page-header\">PHP execution time in php.ini<\/h2>\n<div class=\"level2\">\n<p>The max_execution_time setting sets the maximum time in seconds a PHP script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. This time does not include time spent in system calls or network I\/O (unlike the \u201cLSAPI_MAX_PROCESS_TIME\u201d environment variable above). Thus a process will usually trigger \u201cLSAPI_MAX_PROCESS_TIME\u201d before triggering a max_execution_time setting of a similar length. The default setting is 30.<\/p>\n<p>Example setting (in a php.ini file):<\/p>\n<pre class=\"code\">    max_execution_time=36000<\/pre>\n<\/div>\n<h2 id=\"php_coding\" class=\"sectionedit12 page-header\">PHP coding<\/h2>\n<div class=\"level2\">\n<p>One of our customers had success making sure a PHP script did not time out by adding the following PHP code:<\/p>\n<pre class=\"code\">&lt;?php\r\n\/\/avoid apache to kill the php running\r\nignore_user_abort(true);\r\n\/\/start buffer output\r\nob_start();\r\n\r\necho \"show something to user\";\r\n\/\/close session file on server side to avoid blocking other requests\r\nsession_write_close();\r\n\r\n\/\/send length header\r\nheader(\"Content-Length: \".ob_get_length());\r\nheader(\"Connection: close\");\r\n\/\/really send content, can't change the order:\r\n\/\/1.ob buffer to normal buffer, \r\n\/\/2.normal buffer to output\r\nob_end_flush();\r\nflush();\r\n\/\/continue do something on server side\r\nob_start();\r\n\/\/replace it with the background task\r\nsleep(50); \r\nob_end_clean();\r\n?&gt;<\/pre>\n<p><strong>Note:<\/strong>\u00a0You need to turn off keepalive connections for this request. This can be done with a rewrite rule.<\/p>\n<\/div>\n<h2 id=\"troubleshooting\" class=\"sectionedit13 page-header\">Troubleshooting<\/h2>\n<div class=\"level2\"><\/div>\n<h3 id=\"noabort_rule_should_be_placed_at_the_top_of_the_htaccess\" class=\"sectionedit14\">&#8220;noabort&#8221; rule should be placed at the top of the .htaccess<\/h3>\n<div class=\"level3\">\n<p>A\u00a0<code>test.php<\/code>\u00a0script sets sleep time to 320 seconds, like so:<\/p>\n<pre class=\"code\">?php\r\n\r\n\/\/Store the micro time so that we know\r\n\/\/when our script started to run.\r\n$executionStartTime = microtime(true);\r\n\r\n\/\/ displaying time\r\necho date('h:i:s').\"\\n\" ;\r\n\r\n\/\/ delaying execution of the script for 2 seconds\r\nsleep(320);\r\n\r\n\/\/ displaying time again\r\necho date('h:i:s');\r\n\r\n\/\/At the end of your code, compare the current\r\n\/\/microtime to the microtime that we stored\r\n\/\/at the beginning of the script.\r\n$executionEndTime = microtime(true);\r\n\r\n\/\/The result will be in seconds and milliseconds.\r\n$seconds = $executionEndTime - $executionStartTime;\r\n\r\n\/\/Print it out\r\necho \"This script took $seconds to execute.\";\r\n?&gt;<\/pre>\n<p>When it is run, however, it errors out and stops at 300 seconds (5 minutes).\u00a0<code>phpinfo.php<\/code>\u00a0shows\u00a0<strong>max_exectution_time<\/strong>\u00a0is\u00a0<code>600<\/code>. The script times out due to LiteSpeed Web Server&#8217;s default 300-second timeout. The default, however, can be overridden by a\u00a0<code>noabort<\/code>\u00a0or\u00a0<code>noconntimeout<\/code>\u00a0rule.<\/p>\n<p>In this example,\u00a0<code>.htaccess<\/code>\u00a0<em>does<\/em>\u00a0have a\u00a0<code>noabort<\/code>\u00a0rule, but the test script still stops at 300 seconds:<\/p>\n<pre class=\"code\">Oct8ne\r\n                &lt;IfModule mod_rewrite.c&gt;\r\n                RewriteEngine on\r\n                RewriteRule ^oct8ne\/frame\/([a-zA-Z]+)$ index.php?fc=module&amp;module=oct8ne&amp;controller=oct8neconnector&amp;octmethod=$1&amp;%{QUERY_STRING} [QSA,L]\r\n                &lt;\/IfModule&gt;\r\n                #End_Oct8ne\r\n                # ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again\r\n# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution\r\n# http:\/\/www.prestashop.com - http:\/\/www.prestashop.com\/forums\r\n\r\n&lt;IfModule mod_rewrite.c&gt;\r\n&lt;IfModule mod_env.c&gt;\r\nSetEnv HTTP_MOD_REWRITE On\r\n&lt;\/IfModule&gt;\r\n\r\nRewriteEngine on\r\n\r\n#\r\nRewriteRule . - [E=REWRITEBASE:\/]\r\nRewriteRule ^api$ api\/ [L]\r\n\r\nRewriteRule ^api\/(.*)$ %{ENV:REWRITEBASE}webservice\/dispatcher.php?url=$1 [QSA,L]\r\n\r\n# Images\r\nRewriteRule ^([0-9])(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/p\/$1\/$1$2$3.jpg [L]\r\nRewriteRule ^([0-9])([0-9])(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/p\/$1\/$2\/$1$2$3$4.jpg [L]\r\nRewriteRule ^([0-9])([0-9])([0-9])(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/p\/$1\/$2\/$3\/$1$2$3$4$5.jpg [L]\r\nRewriteRule ^([0-9])([0-9])([0-9])([0-9])(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/p\/$1\/$2\/$3\/$4\/$1$2$3$4$5$6.jpg [L]\r\nRewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/p\/$1\/$2\/$3\/$4\/$5\/$1$2$3$4$5$6$7.jpg [L]\r\nRewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/p\/$1\/$2\/$3\/$4\/$5\/$6\/$1$2$3$4$5$6$7$8.jpg [L]\r\nRewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/p\/$1\/$2\/$3\/$4\/$5\/$6\/$7\/$1$2$3$4$5$6$7$8$9.jpg [L]\r\nRewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/p\/$1\/$2\/$3\/$4\/$5\/$6\/$7\/$8\/$1$2$3$4$5$6$7$8$9$10.jpg [L]\r\nRewriteRule ^c\/([0-9]+)(\\-[\\.*_a-zA-Z0-9-]*)(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/c\/$1$2$3.jpg [L]\r\nRewriteRule ^c\/([a-zA-Z_-]+)(-[0-9]+)?\/.+\\.jpg$ %{ENV:REWRITEBASE}img\/c\/$1$2.jpg [L]\r\n# AlphaImageLoader for IE and fancybox\r\nRewriteRule ^images_ie\/?([^\/]+)\\.(jpe?g|png|gif)$ js\/jquery\/plugins\/fancybox\/images\/$1.$2 [L]\r\n\r\n# Dispatcher\r\nRewriteCond %{REQUEST_FILENAME} -s [OR]\r\nRewriteCond %{REQUEST_FILENAME} -l [OR]\r\nRewriteCond %{REQUEST_FILENAME} -d\r\nRewriteRule ^.*$ - [NC,L]\r\nRewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]\r\n\r\nAddType application\/vnd.ms-fontobject .eot\r\nAddType font\/ttf .ttf\r\nAddType font\/otf .otf\r\nAddType font\/woff2 .woff2\r\nAddType application\/x-font-woff .woff\r\n&lt;IfModule mod_headers.c&gt;\r\n        &lt;FilesMatch \"\\.(ttf|ttc|otf|eot|woff|woff2|svg)$\"&gt;\r\n                Header set Access-Control-Allow-Origin \"*\"\r\n        &lt;\/FilesMatch&gt;\r\n&lt;\/IfModule&gt;\r\n\r\n#If rewrite mod isn't enabled\r\nErrorDocument 404 \/index.php?controller=404\r\n\r\n# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again\r\n\r\n# # BEGIN litespeed noconntimeout noabort\r\n&lt;IfModule Litespeed&gt;\r\n RewriteEngine On\r\n RewriteRule .* - [E=noabort:1]\r\n&lt;\/IfModule&gt;\r\n# # END litespeed noconntimeout noabort\r\n\r\n# php -- BEGIN cPanel-generated handler, do not edit\r\n# Set the \u201cea-php70\u201d package as the default \u201cPHP\u201d programming language.\r\n&lt;IfModule mime_module&gt;\r\n  AddHandler application\/x-httpd-ea-php70 .php .php7 .phtml\r\n&lt;\/IfModule&gt;\r\n# php -- END cPanel-generated handler, do not edit\r\n\r\n# BEGIN cPanel-generated php ini directives, do not edit\r\n# Manual editing of this file may result in unexpected behavior.\r\n# To make changes to this file, use the cPanel MultiPHP INI Editor (Home &gt;&gt; Software &gt;&gt; MultiPHP INI Editor)\r\n# For more information, read our documentation (https:\/\/go.cpanel.net\/EA4ModifyINI)\r\n&lt;IfModule php7_module&gt;\r\n   php_flag display_errors Off\r\n   php_value max_execution_time 600\r\n   php_value max_input_time 600\r\n   php_value max_input_vars 6000\r\n   php_value memory_limit 1024M\r\n   php_value post_max_size 1024M\r\n   php_value session.gc_maxlifetime 1440\r\n   php_value session.save_path \"\/var\/cpanel\/php\/sessions\/ea-php73\"\r\n   php_value upload_max_filesize 1024M\r\n   php_flag zlib.output_compression Off\r\n&lt;\/IfModule&gt;\r\n&lt;IfModule lsapi_module&gt;\r\n   php_flag display_errors Off\r\n   php_value max_execution_time 600\r\n   php_value max_input_time 600\r\n   php_value max_input_vars 6000\r\n   php_value memory_limit 1024M\r\n   php_value post_max_size 1024M\r\n   php_value session.gc_maxlifetime 1440\r\n   php_value session.save_path \"\/var\/cpanel\/php\/sessions\/ea-php73\"\r\n   php_value upload_max_filesize 1024M\r\n   php_flag zlib.output_compression Off\r\n&lt;\/IfModule&gt;\r\n# END cPanel-generated php ini directives, do not edit<\/pre>\n<p>The problem is the position of the\u00a0<code>noabort<\/code>\u00a0rule. it was placed nearly at the end of\u00a0<code>.htaccess<\/code>, and as such, it is prevented from being executed by the other rules that come before it. RewriteRule .* &#8211; [E=noabort:1]<\/p>\n<p>Move the rule to the very top of all\u00a0<code>.htaccess<\/code>\u00a0rewrite rules, and the test script will no longer time out.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Run PHP without Timeouts This covers how to set up LiteSpeed Web Server so that a long-running PHP script will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":488,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[13],"tags":[],"class_list":["post-485","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-litespeed"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Request Timeout - 500 internal server error on Litespeed - HoganHost blog<\/title>\n<meta name=\"description\" content=\"This covers how to set up LiteSpeed Web Server so that a long-running PHP script will not be interrupted before it has finished.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Request Timeout - 500 internal server error on Litespeed - HoganHost blog\" \/>\n<meta property=\"og:description\" content=\"This covers how to set up LiteSpeed Web Server so that a long-running PHP script will not be interrupted before it has finished.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/\" \/>\n<meta property=\"og:site_name\" content=\"HoganHost blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/HoganHost\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-27T23:19:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-12T12:34:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"318\" \/>\n\t<meta property=\"og:image:height\" content=\"159\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abigal okon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hoganhostng\" \/>\n<meta name=\"twitter:site\" content=\"@hoganhostng\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abigal okon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/\"},\"author\":{\"name\":\"Abigal okon\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/person\/af16a18c6cc966b92a6cb13b500f3f0a\"},\"headline\":\"Request Timeout &#8211; 500 internal server error on Litespeed\",\"datePublished\":\"2021-07-27T23:19:55+00:00\",\"dateModified\":\"2024-08-12T12:34:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/\"},\"wordCount\":1143,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png\",\"articleSection\":[\"LiteSpeed\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/\",\"url\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/\",\"name\":\"Request Timeout - 500 internal server error on Litespeed - HoganHost blog\",\"isPartOf\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png\",\"datePublished\":\"2021-07-27T23:19:55+00:00\",\"dateModified\":\"2024-08-12T12:34:44+00:00\",\"description\":\"This covers how to set up LiteSpeed Web Server so that a long-running PHP script will not be interrupted before it has finished.\",\"breadcrumb\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#primaryimage\",\"url\":\"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png\",\"contentUrl\":\"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png\",\"width\":318,\"height\":159},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hoganhost.com.ng\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Request Timeout &#8211; 500 internal server error on Litespeed\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#website\",\"url\":\"https:\/\/hoganhost.com.ng\/blog\/\",\"name\":\"HoganHost blog\",\"description\":\"Keeping you connected to everything from HoganHost\",\"publisher\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hoganhost.com.ng\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#organization\",\"name\":\"HoganHost\",\"url\":\"https:\/\/hoganhost.com.ng\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2022\/09\/hogan-host.png\",\"contentUrl\":\"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2022\/09\/hogan-host.png\",\"width\":466,\"height\":387,\"caption\":\"HoganHost\"},\"image\":{\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/HoganHost\",\"https:\/\/x.com\/hoganhostng\",\"https:\/\/instagram.com\/officialhoganhost\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/person\/af16a18c6cc966b92a6cb13b500f3f0a\",\"name\":\"Abigal okon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ef2272070d016c06ee69b30adce7c4e4b4faaa5c899c4b9224a5b1a43b1fb8d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ef2272070d016c06ee69b30adce7c4e4b4faaa5c899c4b9224a5b1a43b1fb8d0?s=96&d=mm&r=g\",\"caption\":\"Abigal okon\"},\"sameAs\":[\"https:\/\/hoganhost.com.ng\/blog\"],\"url\":\"https:\/\/hoganhost.com.ng\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Request Timeout - 500 internal server error on Litespeed - HoganHost blog","description":"This covers how to set up LiteSpeed Web Server so that a long-running PHP script will not be interrupted before it has finished.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/","og_locale":"en_US","og_type":"article","og_title":"Request Timeout - 500 internal server error on Litespeed - HoganHost blog","og_description":"This covers how to set up LiteSpeed Web Server so that a long-running PHP script will not be interrupted before it has finished.","og_url":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/","og_site_name":"HoganHost blog","article_publisher":"https:\/\/facebook.com\/HoganHost","article_published_time":"2021-07-27T23:19:55+00:00","article_modified_time":"2024-08-12T12:34:44+00:00","og_image":[{"width":318,"height":159,"url":"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png","type":"image\/png"}],"author":"Abigal okon","twitter_card":"summary_large_image","twitter_creator":"@hoganhostng","twitter_site":"@hoganhostng","twitter_misc":{"Written by":"Abigal okon","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#article","isPartOf":{"@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/"},"author":{"name":"Abigal okon","@id":"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/person\/af16a18c6cc966b92a6cb13b500f3f0a"},"headline":"Request Timeout &#8211; 500 internal server error on Litespeed","datePublished":"2021-07-27T23:19:55+00:00","dateModified":"2024-08-12T12:34:44+00:00","mainEntityOfPage":{"@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/"},"wordCount":1143,"commentCount":0,"publisher":{"@id":"https:\/\/hoganhost.com.ng\/blog\/#organization"},"image":{"@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#primaryimage"},"thumbnailUrl":"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png","articleSection":["LiteSpeed"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/","url":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/","name":"Request Timeout - 500 internal server error on Litespeed - HoganHost blog","isPartOf":{"@id":"https:\/\/hoganhost.com.ng\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#primaryimage"},"image":{"@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#primaryimage"},"thumbnailUrl":"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png","datePublished":"2021-07-27T23:19:55+00:00","dateModified":"2024-08-12T12:34:44+00:00","description":"This covers how to set up LiteSpeed Web Server so that a long-running PHP script will not be interrupted before it has finished.","breadcrumb":{"@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#primaryimage","url":"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png","contentUrl":"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2021\/07\/download-1.png","width":318,"height":159},{"@type":"BreadcrumbList","@id":"https:\/\/hoganhost.com.ng\/blog\/server\/litespeed\/request-timeout-500-internal-server-error-on-litespeed\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hoganhost.com.ng\/blog\/"},{"@type":"ListItem","position":2,"name":"Request Timeout &#8211; 500 internal server error on Litespeed"}]},{"@type":"WebSite","@id":"https:\/\/hoganhost.com.ng\/blog\/#website","url":"https:\/\/hoganhost.com.ng\/blog\/","name":"HoganHost blog","description":"Keeping you connected to everything from HoganHost","publisher":{"@id":"https:\/\/hoganhost.com.ng\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hoganhost.com.ng\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hoganhost.com.ng\/blog\/#organization","name":"HoganHost","url":"https:\/\/hoganhost.com.ng\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2022\/09\/hogan-host.png","contentUrl":"https:\/\/hoganhost.com.ng\/blog\/wp-content\/uploads\/2022\/09\/hogan-host.png","width":466,"height":387,"caption":"HoganHost"},"image":{"@id":"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/HoganHost","https:\/\/x.com\/hoganhostng","https:\/\/instagram.com\/officialhoganhost"]},{"@type":"Person","@id":"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/person\/af16a18c6cc966b92a6cb13b500f3f0a","name":"Abigal okon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hoganhost.com.ng\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ef2272070d016c06ee69b30adce7c4e4b4faaa5c899c4b9224a5b1a43b1fb8d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef2272070d016c06ee69b30adce7c4e4b4faaa5c899c4b9224a5b1a43b1fb8d0?s=96&d=mm&r=g","caption":"Abigal okon"},"sameAs":["https:\/\/hoganhost.com.ng\/blog"],"url":"https:\/\/hoganhost.com.ng\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/posts\/485","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/comments?post=485"}],"version-history":[{"count":3,"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/posts\/485\/revisions"}],"predecessor-version":[{"id":489,"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/posts\/485\/revisions\/489"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/media\/488"}],"wp:attachment":[{"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/media?parent=485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/categories?post=485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hoganhost.com.ng\/blog\/wp-json\/wp\/v2\/tags?post=485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}