Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
litespeed_wiki:php:detached_mode [2018/09/20 16:20]
Jackson Zhang
litespeed_wiki:php:detached_mode [2019/02/13 20:45]
Jackson Zhang [PHP Processes Won't Run Forever]
Line 27: Line 27:
   touch <​user_home_dir>/​.lsphp_restart.txt   touch <​user_home_dir>/​.lsphp_restart.txt
   ​   ​
 +To make it compatible with CloudLinux mod_lsapi CRIU feature, server will restart PHP by ''​mod_lsapi_reset_me''​ as well 
 +  ​
 +  touch <​user_home_dir>/​mod_lsapi_reset_me
 +
 The user can also restart detached PHP processes from the '​Advanced'​ page of the [[litespeed_wiki:​cpanel:​cpanel-plugin|LiteSpeed Web Cache Manager cPanel plugin]], accessible from within their cPanel dashboard. The user can also restart detached PHP processes from the '​Advanced'​ page of the [[litespeed_wiki:​cpanel:​cpanel-plugin|LiteSpeed Web Cache Manager cPanel plugin]], accessible from within their cPanel dashboard.
  
Line 43: Line 47:
  
 ===== PHP Processes Won't Run Forever ===== ===== PHP Processes Won't Run Forever =====
-PHP Detached Mode doesn'​t mean that PHP will run forever. It will still follow the [[https://​www.litespeedtech.com/​docs/​webserver/​config/​extapps/​lsapi#​extMaxIdleTime |Max Idle Time]] setting. If you want to make PHP live longer, just increase **Max Idle Time**. ​+PHP Detached Mode doesn'​t mean that PHP will run forever. It will still follow the [[https://​www.litespeedtech.com/​docs/​webserver/​config/​extapps/​lsapi#​extMaxIdleTime |Max Idle Time]] setting. If you want to make PHP live longer, just increase **Max Idle Time**.  Never set it as "​-1"​ to means as "​unlimited"​ since, in process group mode, it will be automatically converted to default 30 seconds. If you want PHP to be running longer, try to enter a large number, such as "​3600"​.
  
 ===== PHP Auto Configuration for Different Control Panels ===== ===== PHP Auto Configuration for Different Control Panels =====
Line 73: Line 77:
  
  
-===== ea-phpxx and alt-phpxx are different handlers on LSWS 5.3 while same on LSWS 5.2.x and below ===== +===== Troubleshooting ​=====
- +
-LSWS 5.3 speically adds alt-phpxx(CloudLinux PHP selector) handlers'​ suppport for cPanel and CloudLinux system hence alt-phpxx are different than ea-phpxx. On previous version of LSWS 5.2.x and below, there is no separate handler between alt-phpxx and ea-phpxx +
-and both of them use ea-phpxx handlers.  +
- +
-The above feature will support latest cPanel multi-PHP manager more friendly since either alt-phpxx or ea-phpxx can be selected for a domain, instead of just ea-phpxx only. Then cPanel will add the following to .htaccess depending on which php was selected. LSWS 5.3 will use alt-phpxx or ea-phpxx according to user's choice. ​ On LSWS 5.2.x and below version, LSWS will only set ea-phpxx no matter alt-phpxx or ea-phpxx selected. +
- +
-  AddType application/​x-httpd-alt-php70 .php .php7 .phtml +
-or  +
-  AddType application/​x-httpd-ea-php70 .php .php7 .phtml +
- +
- +
-On LSWS 5.2.x, if you set all lsphpxx binary to use alt-phpxx for all handlers and set some per directory php as the following by using ea-phpxx in .htaccess.  +
- +
-  AddType application/​x-httpd-ea-php54 .php .php7 .phtml +
-or  +
-  <​FilesMatch "​.(php4|php5|php3|php2|php|phtml)$">​ +
-  SetHandler application/​x-httpd-ea-php54 +
-  </​FilesMatch>​ +
- +
-It works with LSWS 5.2.x but doesn'​t work with LSWS 5.3. Why? +
- +
-LSWS 5.3 treats ea-phpXX handler and alt-phpXX handler separately.  +
-If the server only have ea-php70 installed and other ea-phpXX handler is not available, then +
- +
-  SetHandler application/​x-httpd-ea-php54 +
-or +
-  SetHandler application/​x-httpd-ea-php55 +
- +
-will fail. +
- +
-5.2.x treat ea-phpXX and alt-phpXX handler the same and handled by lsphpXX handler which pointing to alt-php binary. +
- +
-How to fix it? +
- +
-==== Method1: You should use right Handler for LSWS 5.3 now ==== +
- +
-In .htaccess, you should change: +
-  SetHandler application/​x-httpd-ea-php54 +
-to  +
-  SetHandler application/​x-httpd-alt-php54 +
-   +
-and you should use the right one moving forward. But it seems a little time consuming to change all handler settings in all .htaccess for 5.2.x to 5.3 migration. There is another way as the following:​ +
- +
-==== Method2: Make LSWS 5.3 behaves as 5.2.x ====+
  
-Instead of scanning .htaccess to fix wrong handler configuration,​ it is possible to make 5.3 behave the same as 5.2.x. +  * [[litespeed_wiki:​php:​detached_mode:​handlers | Managing ​ea-phpxx and alt-phpxx differences between LSWS v5.3 and previous versions]]
-Please update the name of lsphpXX external app from lsphpXX to ea-phpXX, the executable path is still pointing to alt-php binary. this way, ea-phpXX, alt-phpXX, ​and lsphpXX are all handled by alt-php handlers.+
  
  • Admin
  • Last modified: 2020/02/26 22:53
  • by Lucas Rolff