Differences

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

Link to this comparison view

Both sides previous revision Previous revision
litespeed_wiki:cpanel:use-cloudlinuxphpselector-on-ea4-with-lsws [2018/08/10 21:31]
Jackson Zhang [alt-php within Multi-php Manager]
litespeed_wiki:cpanel:use-cloudlinuxphpselector-on-ea4-with-lsws [2018/08/13 15:09] (current)
Lisa Clarke [Why CloudLinux PHP selector works on Apache but does not work on LSWS?] Proofreading
Line 95: Line 95:
  
  
-===== Why CloudLinux PHP selector works on Apache but does not work on LSWS===== +===== Why CloudLinux PHP Selector Works on Apache but Does Not Work on LSWS ===== 
-At cPanel EA4 and CloudLinux environment,​ Most of the LSWS LSPHP external apps such as lsphpxx are poiting ​to ea-phpxx, instead of  +In a cPanel EA4 and CloudLinux environment,​ Most of the LSWS LSPHP external apps such as ''​lsphpxx'' ​are pointing ​to ''​ea-phpxx''​, instead of ''​alt-phpxx''​. Only one external app, ''​cl_phpselector'' ​is pointing ​to ''​/​usr/​local/​bin/​lsphp'' ​(the CloudLinux PHP selector binary).
-alt-phpxx. Only one external app "cl_phpselector" ​is poiting ​to "/​usr/​local/​bin/​lsphp" ​(CloudLinux PHP selector binary).+
   lsphp54->​ /​opt/​cpanel/​ea-php54/​root/​usr/​bin/​lsphp   lsphp54->​ /​opt/​cpanel/​ea-php54/​root/​usr/​bin/​lsphp
   lsphp55->​ /​opt/​cpanel/​ea-php55/​root/​usr/​bin/​lsphp   lsphp55->​ /​opt/​cpanel/​ea-php55/​root/​usr/​bin/​lsphp
Line 104: Line 103:
   lsphp71->​ /​opt/​cpanel/​ea-php71/​root/​usr/​bin/​lsphp   lsphp71->​ /​opt/​cpanel/​ea-php71/​root/​usr/​bin/​lsphp
   lsphp72->​ /​opt/​cpanel/​ea-php72/​root/​usr/​bin/​lsphp   lsphp72->​ /​opt/​cpanel/​ea-php72/​root/​usr/​bin/​lsphp
-  cl_phpselector->/​usr/​local/​bin/​lsphp+  cl_phpselector->​ /​usr/​local/​bin/​lsphp
  
-For PHP handlers:+PHP handlers:
   php  -> cl_phpselector   php  -> cl_phpselector
   php5 -> cl_phpselector   php5 -> cl_phpselector
Line 116: Line 115:
   php72-> lsphp72   php72-> lsphp72
     ​     ​
- The above is the recommended way and default setup for such an environment. ​+The above is the recommended wayand is the default setup for such an environment. ​
  
 {{ :​litespeed_wiki:​cpanel:​cpanel-ea4-cloudlinux-apache-lsws-different-php.png?​800 |}} {{ :​litespeed_wiki:​cpanel:​cpanel-ea4-cloudlinux-apache-lsws-different-php.png?​800 |}}
  
-Some users may want to point every external handler to alt-phpxx. Such as the following: +Some users may want to point every external handler to ''​alt-phpxx'',​ like so:
   lsphp54->​ /​opt/​alt/​php54/​usr/​bin/​lsphp   lsphp54->​ /​opt/​alt/​php54/​usr/​bin/​lsphp
   lsphp55->​ /​opt/​alt/​php55/​usr/​bin/​lsphp   lsphp55->​ /​opt/​alt/​php55/​usr/​bin/​lsphp
Line 130: Line 128:
   cl_phpselector->/​usr/​local/​bin/​lsphp   cl_phpselector->/​usr/​local/​bin/​lsphp
   ​   ​
- ​Which ​causes a problem: when a user account inherited cpanel system default PHP version and CloudLinux PHP selector is set to use php70 for that user account, Why apache seems returning the right version of php70 but LSWS seems always returning php56  or other php version alighing with cpanel multi-php manager system default php version?+This causes a problem.
  
-Actually there is nothing wrong with LSWS, LSWS is still follow CloudLinux-cPanel-EA4 php determination work flow+For example: A user account inherits the cPanel system default PHP version, and the CloudLinux PHP selector ​is set to use ''​php70''​ for that user account. Apache seems to return the correct version of ''​php70''​but LSWS always seems to return ''​php56''​ (or whatver ​cPanel's Multi PHP Manager system default PHP version is).
  
-When a user account inherited cpanel system default PHP configurated from cPanel Multi PHP Manageron Apache, CloudLinux PHP Selector ​is used hence it returns right php version ​On ​LSWS, since you change ​the external app associated with cpanel default version ea-php56 in this example. It will look for suffix php56, which is currently using lsphp56.+In actualitythere is nothing wrong with LiteSpeed Web Server. LSWS is following ​the correct CloudLinux-cPanel-EA4 PHP determination work flow
  
-lsphp56 was+  * **Apache**When a user account inherits the cPanel system default PHP configuration from cPanel Multi PHP Manager, the CloudLinux PHP Selector is used. Hence it returns the right PHP version.  ​ 
- lsphp56->​ /​opt/​cpanel/​ea-php56/​root/​usr/​bin/​lsphp+  * **LSWS**: Since you changed the external app associated with the cPanel default version (''​ea-php56''​ in this example), it will look for the suffix ''​php56'',​ which points to ''​lsphp56''​.
  
-However somehow you changed it to the following already+''​lsphp56''​ was: 
- ​lsphp56->​ /​opt/​alt/​php56/​usr/​bin/​lsphp+  lsphp56->​ /​opt/​cpanel/​ea-php56/​root/​usr/​bin/​lsphp 
 + 
 +You changed it to: 
 +  lsphp56->​ /​opt/​alt/​php56/​usr/​bin/​lsphp
  
-then /​opt/​alt/​php56/​usr/​bin/​lsphp is differnt than cpanel ​default ea-php56( /​opt/​cpanel/​ea-php56/​root/​usr/​bin/​lsphp),​ hence CloudLinux PHP Selector won't be used, instead, ​lsphp56 (/​opt/​alt/​php56/​usr/​bin/​lsphp) will be always used for LSWS.+''​/​opt/​alt/​php56/​usr/​bin/​lsphp'' ​is differnt than cPanel'​s ​default ​''​ea-php56''​(which is  ''​/​opt/​cpanel/​ea-php56/​root/​usr/​bin/​lsphp''​), hence the CloudLinux PHP Selector won't be used. Instead''​lsphp56'' ​(or, ''​/​opt/​alt/​php56/​usr/​bin/​lsphp''​) will be always used for LSWS.
  
-How to fix it? The key is to tell LSWS to use CloudLinux PHP selector instead of a particular version of alt-php.+So, how can you get the PHP version you want? The key is to tell LSWS to use the CloudLinux PHP selector instead of a particular version of alt-php.
  
-You can either update external app lsphp56 to point to PHP selector binary ​"/​usr/​local/​bin/​lsphp", or more easily, update ​php handler of suffix ​"php56" ​to served by "cl_phpselector" ​instead of "lsphp56".+You can either update ​the external app ''​lsphp56'' ​to point to PHP selector binary ​''​/​usr/​local/​bin/​lsphp''​, or more easily, update ​the PHP handler of suffix ​''​php56'' ​to be served by ''​cl_phpselector'' ​instead of ''​lsphp56''​.
  
-You can apply the second solution through command line or through LSWS Web Admin Console.+You can apply the second solution through ​the command line or through LSWS Web Admin Console.
  
-Through ​command line: +==== Through ​the Command Line ==== 
-vi /​usr/​local/​lsws/​conf/​httpd_config.xml+  vi /​usr/​local/​lsws/​conf/​httpd_config.xml
  
-Current:+Change:
     <​scriptHandler>​     <​scriptHandler>​
       <​suffix>​php56</​suffix>​       <​suffix>​php56</​suffix>​
Line 159: Line 160:
       <​handler>​lsphp56</​handler>​       <​handler>​lsphp56</​handler>​
     </​scriptHandler>​     </​scriptHandler>​
-Change to:+To:
     <​scriptHandler>​     <​scriptHandler>​
       <​suffix>​php56</​suffix>​       <​suffix>​php56</​suffix>​
Line 166: Line 167:
     </​scriptHandler>​     </​scriptHandler>​
     ​     ​
-Through LSWS Web Admin Console:+==== Through LSWS Web Admin Console ​====
  
 Before: Before:
 {{ :​litespeed_wiki:​cpanel:​cpanel-ea4-cloudlinux-apache-lsws-different-php-beforefix.png?​800 |}} {{ :​litespeed_wiki:​cpanel:​cpanel-ea4-cloudlinux-apache-lsws-different-php-beforefix.png?​800 |}}
-After fix:+After:
 {{ :​litespeed_wiki:​cpanel:​cpanel-ea4-cloudlinux-apache-lsws-different-php-afterfix.png?​800 |}} {{ :​litespeed_wiki:​cpanel:​cpanel-ea4-cloudlinux-apache-lsws-different-php-afterfix.png?​800 |}}
  
-Restart LSWS after configuration change.+Restart LSWS after any configuration change.
 
litespeed_wiki/cpanel/use-cloudlinuxphpselector-on-ea4-with-lsws.1533936708.txt.gz · Last modified: 2018/08/10 21:31 by Jackson Zhang