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
litespeed_wiki:php:detached_mode [2019/07/12 16:09]
Jackson Zhang [For a User]
litespeed_wiki:php:detached_mode [2019/08/21 20:36] (current)
Jackson Zhang [What is PHP Detached Mode?]
Line 2: Line 2:
  
 ===== What is PHP Detached Mode? ===== ===== What is PHP Detached Mode? =====
-PHP Detached Mode is a big feature available in LSWS 5.3 and later. ​+PHP Detached Mode is a big feature available in LSWS 5.3 and later. OpenLiteSpeed supports PHP detached mode starting from 1.5.6.
  
 In previous versions (LSWS 5.2.x and below), all PHP processes were attached to LiteSpeed Web Server processes. As such, when LiteSpeed Web Server restarted, so would the PHP processes. In PHP Detached Mode, the PHP processes will continue running independently,​ even when LiteSpeed Web Server restarts.  ​ In previous versions (LSWS 5.2.x and below), all PHP processes were attached to LiteSpeed Web Server processes. As such, when LiteSpeed Web Server restarted, so would the PHP processes. In PHP Detached Mode, the PHP processes will continue running independently,​ even when LiteSpeed Web Server restarts.  ​
Line 23: Line 23:
  
 ==== For a User ==== ==== For a User ====
-To restart detached PHP processes for the account (vhost) level, you can touch a ''​.lsphp_restart.txt''​ file under the user's home directory, ​such as /​home/​USER1/​ on cpanel/WHM server:+To restart detached PHP processes for the account (vhost) level, you can touch a ''​.lsphp_restart.txt''​ file under the user's home directory, ​for example ''​/​home/​USER1/​'' ​on a cPanel/WHM server:
  
-  touch <​user_home_dir>​/​.lsphp_restart.txt+  touch /home/USER1/​.lsphp_restart.txt
   ​   ​
-After the ''​.lsphp_restart.txt'' ​was created, the user's PHP should ​be restarted when next request comes. ​ The file ''​.lsphp_restart.txt''​ won't be removed ​after the creation. LSWS only checks ​the timestamp of the file to decide if the user's detached PHP needs to be restarted or not.  You can manually remove it if you want but not necessary. Every time you want to restart that user's detached PHP, you can just touch again no matter ​it exists or not to refresh the timestamp.  +Once ''​.lsphp_restart.txt'' ​is created, the user's PHP will be restarted when next request comes in.  The file ''​.lsphp_restart.txt''​ won't be removed. LSWS will check the timestamp of the file to decide if the user's detached PHP needs to be restarted or not. You can manually remove it if you want to but it'​s ​not necessary. Every time you want to restart that user's detached PHP, you can just touch the file again, whether ​it already ​exists or not, in order to refresh the timestamp.  
-   + 
-To make it compatible with CloudLinux mod_lsapi CRIU feature, server will restart PHP by ''​mod_lsapi_reset_me''​ as well +To maintain ​CloudLinux mod_lsapi CRIU feature ​compatibilitythe server will restart PHP if it finds a ''​mod_lsapi_reset_me'' ​file as well
   ​   ​
   touch <​user_home_dir>/​mod_lsapi_reset_me   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 may 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 ​the cPanel dashboard.
  
 ==== For the Server ==== ==== For the Server ====
  • Admin
  • Last modified: 2019/07/12 16:09
  • by Jackson Zhang