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:cpanel:use-cloudlinuxphpselector-on-ea4-with-lsws [2018/04/11 14:17]
Eric Leu [Changing the Default]
litespeed_wiki:cpanel:use-cloudlinuxphpselector-on-ea4-with-lsws [2018/08/10 21:31]
Jackson Zhang [alt-php within Multi-php Manager]
Line 40: Line 40:
  
 Run the following command to check ''​example1''​ user: Run the following command to check ''​example1''​ user:
-  /usr/bin/cl-selector ​--summary ​php --user example1+  /usr/bin/selectorctl ​--user-summary --user example1
   5.1 e - -   5.1 e - -
   5.2 e - -   5.2 e - -
Line 52: Line 52:
   native e d s   native e d s
 You can set it to use ''​CL PHP Selector 7.0''​ instead of ''​native'':​ You can set it to use ''​CL PHP Selector 7.0''​ instead of ''​native'':​
-  /​usr/​bin/​cl-selector --select=php --version=7.0 --user example1 
-or  ​ 
   selectorctl --set-user-current=7.0 --user=example1   selectorctl --set-user-current=7.0 --user=example1
 To verify: ​ To verify: ​
-  /usr/bin/cl-selector ​--summary ​php --user example1+  /usr/bin/selectorctl ​--user-summary --user example1
   5.1 e - -   5.1 e - -
   5.2 e - -   5.2 e - -
Line 88: Line 86:
 For more on this, see [[https://​docs.cloudlinux.com/​index.html?​php_selector_cpanel.html|the CloudLinux documentation]]. For more on this, see [[https://​docs.cloudlinux.com/​index.html?​php_selector_cpanel.html|the CloudLinux documentation]].
  
-===== alt-php within Multi-php Manager ​is not supported by LiteSpeed yet =====+===== alt-php within Multi-php Manager ===== 
 +**It will be supported from 5.3RC1**
  
-In cPanel & WHM version 66 and later, EasyApache 4 allows you to use Vendor-provided PHP versions such as CloudLinux PHP selector right from MultiPHP Manager, such as ''​alt-php44'',​ ''​alt-php51'',​ ''​alt-php52'',​ ''​alt-php53'',​ ''​alt-hpp54'',​ ''​alt-php55'',​ ''​alt-php56'',​ ''​alt-php70'',​ ''​alt-php71'',​ they are not yet supported by LiteSpeed. ​Please ​continue to use ''​ea-phpxx''​ and follow the above steps to determine if CloudLinux PHP selector is used,  but not directly from MultiPHP Manager.  ​+ 
 +In cPanel & WHM version 66 and later, EasyApache 4 allows you to use Vendor-provided PHP versions such as CloudLinux PHP selector right from MultiPHP Manager, such as ''​alt-php44'',​ ''​alt-php51'',​ ''​alt-php52'',​ ''​alt-php53'',​ ''​alt-hpp54'',​ ''​alt-php55'',​ ''​alt-php56'',​ ''​alt-php70'',​ ''​alt-php71'',​ ''​alt-php72'',​ they will be supported by LiteSpeed ​from 5.3RC1. If your version under it, please ​continue to use ''​ea-phpxx''​ and follow the above steps to determine if CloudLinux PHP selector is used,  but not directly from MultiPHP Manager.  ​
  
 {{ :​litespeed_wiki:​cpanel:​cpanel-multiphp-altphp.png?​600 |}} {{ :​litespeed_wiki:​cpanel:​cpanel-multiphp-altphp.png?​600 |}}
 +
 +
 +===== 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 
 +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
 +  lsphp55->​ /​opt/​cpanel/​ea-php55/​root/​usr/​bin/​lsphp
 +  lsphp56->​ /​opt/​cpanel/​ea-php56/​root/​usr/​bin/​lsphp
 +  lsphp70->​ /​opt/​cpanel/​ea-php70/​root/​usr/​bin/​lsphp
 +  lsphp71->​ /​opt/​cpanel/​ea-php71/​root/​usr/​bin/​lsphp
 +  lsphp72->​ /​opt/​cpanel/​ea-php72/​root/​usr/​bin/​lsphp
 +  cl_phpselector->/​usr/​local/​bin/​lsphp
 +
 +For PHP handlers:
 +  php  -> cl_phpselector
 +  php5 -> cl_phpselector
 +  php54-> lsphp54
 +  php55-> lsphp55 ​  
 +  php56-> lsphp56
 +  php70-> lsphp70
 +  php71-> lsphp71
 +  php72-> lsphp72
 +    ​
 + The above is the recommended way and default setup for such an environment. ​
 +
 +{{ :​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:
 +
 +  lsphp54->​ /​opt/​alt/​php54/​usr/​bin/​lsphp
 +  lsphp55->​ /​opt/​alt/​php55/​usr/​bin/​lsphp
 +  lsphp56->​ /​opt/​alt/​php56/​usr/​bin/​lsphp
 +  lsphp70->​ /​opt/​alt/​php70/​usr/​bin/​lsphp
 +  lsphp71->​ /​opt/​alt/​php71/​usr/​bin/​lsphp
 +  lsphp72->​ /​opt/​alt/​php72/​usr/​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?
 +
 +Actually there is nothing wrong with LSWS, LSWS is still follow CloudLinux-cPanel-EA4 php determination work flow. 
 +
 +When a user account inherited cpanel system default PHP configurated from cPanel Multi PHP Manager, on 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.
 +
 +lsphp56 was:
 + ​lsphp56->​ /​opt/​cpanel/​ea-php56/​root/​usr/​bin/​lsphp
 +
 +However somehow you changed it to the following already:
 + ​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.
 +
 +How to fix it? The key is to tell LSWS to use 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 apply the second solution through command line or through LSWS Web Admin Console.
 +
 +Through command line:
 +vi /​usr/​local/​lsws/​conf/​httpd_config.xml
 +
 +Current:
 +    <​scriptHandler>​
 +      <​suffix>​php56</​suffix>​
 +      <​type>​lsapi</​type>​
 +      <​handler>​lsphp56</​handler>​
 +    </​scriptHandler>​
 +Change to:
 +    <​scriptHandler>​
 +      <​suffix>​php56</​suffix>​
 +      <​type>​lsapi</​type>​
 +      <​handler>​cl_phpselector</​handler>​
 +    </​scriptHandler>​
 +    ​
 +Through LSWS Web Admin Console:
 +
 +Before:
 +{{ :​litespeed_wiki:​cpanel:​cpanel-ea4-cloudlinux-apache-lsws-different-php-beforefix.png?​800 |}}
 +After fix:
 +{{ :​litespeed_wiki:​cpanel:​cpanel-ea4-cloudlinux-apache-lsws-different-php-afterfix.png?​800 |}}
 +
 +Restart LSWS after configuration change.
  • Admin
  • Last modified: 2019/09/25 15:43
  • by Jackson Zhang