{"id":19385,"date":"2023-06-28T07:48:14","date_gmt":"2023-06-28T06:48:14","guid":{"rendered":"https:\/\/supporttest.hemsida.eu\/artikel\/hur-far-jag-mina-tidskravande-php-processer-att-kora-klart\/"},"modified":"2023-06-28T09:48:16","modified_gmt":"2023-06-28T08:48:16","slug":"how-do-i-get-long-running-php-processes-to-finish-executing","status":"publish","type":"ht_kb","link":"https:\/\/supporttest.hemsida.eu\/en\/artikel\/how-do-i-get-long-running-php-processes-to-finish-executing\/","title":{"rendered":"How do I get long-running PHP processes to finish executing?"},"content":{"rendered":"\n<p>Sometimes you may have PHP processes that need an extra long time to finish, and then you usually adjust the settings for <code>max_execution_time<\/code> and <code>max_input_time<\/code> in the <a rel=\"noreferrer noopener\" href=\"https:\/\/supporttest.hemsida.eu\/en\/artikel\/how-do-i-manage-php\/\" data-type=\"ht_kb\" data-id=\"8338\" target=\"_blank\">PHP settings<\/a> (<code>Select PHP version<\/code> in cPanel -&gt; <code>Options<\/code> tab).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/supporttest.hemsida.eu\/wp-content\/uploads\/2023\/06\/cpanel_select_php_version_max_execution_input_time.png\"><img loading=\"lazy\" decoding=\"async\" width=\"777\" height=\"220\" src=\"https:\/\/supporttest.hemsida.eu\/wp-content\/uploads\/2023\/06\/cpanel_select_php_version_max_execution_input_time.png\" alt=\"\" class=\"wp-image-19379\" srcset=\"https:\/\/supporttest.hemsida.eu\/wp-content\/uploads\/2023\/06\/cpanel_select_php_version_max_execution_input_time.png 777w, https:\/\/supporttest.hemsida.eu\/wp-content\/uploads\/2023\/06\/cpanel_select_php_version_max_execution_input_time-300x85.png 300w, https:\/\/supporttest.hemsida.eu\/wp-content\/uploads\/2023\/06\/cpanel_select_php_version_max_execution_input_time-768x217.png 768w, https:\/\/supporttest.hemsida.eu\/wp-content\/uploads\/2023\/06\/cpanel_select_php_version_max_execution_input_time-50x14.png 50w, https:\/\/supporttest.hemsida.eu\/wp-content\/uploads\/2023\/06\/cpanel_select_php_version_max_execution_input_time-60x17.png 60w, https:\/\/supporttest.hemsida.eu\/wp-content\/uploads\/2023\/06\/cpanel_select_php_version_max_execution_input_time-100x28.png 100w\" sizes=\"auto, (max-width: 777px) 100vw, 777px\" \/><\/a><\/figure>\n\n\n\n<p>However, this is not always enough, and you still get timeouts on your scripts &#8211; for example, if you have a large webshop and want to export all orders and\/or products.<\/p>\n\n\n\n<p>What you can do is to tell LSWS (LiteSpeed Web Server), our alternative to Apache that runs on all servers for <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.com\/web-hosting\/\" target=\"_blank\">web hosting accounts<\/a> and on <a rel=\"noreferrer noopener\" href=\"https:\/\/www.oderland.com\/managed-server\/\" target=\"_blank\">Managed Servers<\/a> that have selected LSWS as an add-on, to keep processes alive for as long as possible.<\/p>\n\n\n\n<p>The easiest way to do this is to put the following code at the top of the <code>.htaccess<\/code> file for the site in question:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;IfModule Litespeed&gt; \n    RewriteEngine On\n    RewriteRule .* - [E=noabort:1, E=noconntimeout:1]\n&lt;\/IfModule&gt; <\/pre>\n\n\n\n<p>The .htaccess file can be edited via <a href=\"https:\/\/supporttest.hemsida.eu\/en\/artikel\/how-do-i-use-the-file-manager-in-cpanel\/\" data-type=\"ht_kb\" data-id=\"4886\" target=\"_blank\" rel=\"noreferrer noopener\">cPanel&#8217;s File Manager<\/a> or via <a href=\"https:\/\/supporttest.hemsida.eu\/en\/artikel\/how-do-i-connect-to-my-web-hosting-account-using-ssh\/\" data-type=\"ht_kb\" data-id=\"4832\" target=\"_blank\" rel=\"noreferrer noopener\">SSH<\/a>\/FTP.<\/p>\n\n\n\n<p>For more information on this solution and its variants, please refer to the <a href=\"https:\/\/www.litespeedtech.com\/support\/wiki\/doku.php\/litespeed_wiki:php:run-without-timeouts\" target=\"_blank\" rel=\"noreferrer noopener\">official documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you may have PHP processes that need an extra long time to finish, and then you usually adjust the settings for max_execution_time and max_input_time in the PHP settings (Select PHP version in cPanel -&gt; Options tab). However, this is not always enough, and you still get timeouts on your&#8230;<\/p>\n","protected":false},"author":12,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"ht-kb-category":[213],"ht-kb-tag":[],"class_list":["post-19385","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-developer-tools"],"acf":[],"_links":{"self":[{"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/ht-kb\/19385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/comments?post=19385"}],"version-history":[{"count":4,"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/ht-kb\/19385\/revisions"}],"predecessor-version":[{"id":19390,"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/ht-kb\/19385\/revisions\/19390"}],"wp:attachment":[{"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/media?parent=19385"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/ht-kb-category?post=19385"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/supporttest.hemsida.eu\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=19385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}