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:cloudlinux:php-selector [2016/06/16 14:53]
Jackson Zhang [Pre-requisites]
litespeed_wiki:cloudlinux:php-selector [2020/07/18 11:34] (current)
qtwrk
Line 6: Line 6:
 Cloudlinux has added their support in PHP Selector to work with lsphp in LiteSpeed Web server. It leverages the same PHP Selector GUI so that user can switch between different lsphp versions in LiteSpeed Web Server without going to LiteSpeed Admin Console to build LSPHP separately. Cloudlinux has added their support in PHP Selector to work with lsphp in LiteSpeed Web server. It leverages the same PHP Selector GUI so that user can switch between different lsphp versions in LiteSpeed Web Server without going to LiteSpeed Admin Console to build LSPHP separately.
  
-In brief, Cloudlinux'​ PHP Selector, LVE Manager and CageFS need to be installed and enabled; LSWS' lsphp5 external app needs to be in suEXEC ​non-daemon mode (for example, ​suEXEC worker ​mode or suEXEC Process Group mode. suEXEC daemon ​mode is incompatible with PHP Selector) with lsphp5 binary being set to a symlink that eventually points to the actual PHP binary of user's choice in CageFS.+In brief, Cloudlinux'​ PHP Selector, LVE Manager and CageFS need to be installed and enabled; LSWS' lsphp5 external app PHP process mode needs to be in non-daemon mode (for example, ​Worker ​mode or ProcessGroup ​mode. Daemon ​mode is incompatible with PHP Selector) with lsphp5 binary being set to a symlink that eventually points to the actual PHP binary of user's choice in CageFS.
  
 You can also check [[http://​docs.cloudlinux.com/​index.html?​php_selector.html|Cloudlinux PHP Selector]] and [[http://​docs.cloudlinux.com/​index.html?​litespeed_support.html|Cloudlinux PHP Selector LiteSpeed Support]] documentation. You can also check [[http://​docs.cloudlinux.com/​index.html?​php_selector.html|Cloudlinux PHP Selector]] and [[http://​docs.cloudlinux.com/​index.html?​litespeed_support.html|Cloudlinux PHP Selector LiteSpeed Support]] documentation.
  
 +You can still use other php configuration such as **LiteSpeed lsphp**, **cpanel easy apache php** or **plesk php** instead of PHP Selector even on a CloudLinux Box if you like, however PHP selector is a recommended way. 
 +===== Installation =====
  
 +Followings need to be installed and/or enabled. If They have been installed and enabled, you can skip to next step for LiteSpeed configuration.
  
- 
- 
- 
- 
- 
- 
- 
- 
-===== Pre-requisites ===== 
- 
-CloudLinux: 
- 
-Followings need to be installed and/or enabled: 
- 
-  - PHP Selector 
   - LVE Manager   - LVE Manager
   - CageFS   - CageFS
- +  - PHP Selector 
-Refer to CloudLinux [[http://​docs.cloudlinux.com/​installation.html|document]] for installation details and how to enable.  + 
- +
-===== Installation =====+
  
 === a. Install alt-php packages from CloudLinux repository === === a. Install alt-php packages from CloudLinux repository ===
Line 41: Line 27:
  
     yum update cagefs lvemanager ​     yum update cagefs lvemanager ​
- 
-As of this writing (3/15/13), the correct package version should be: 
-    cagefs-4.0-14 
-    lvemanager-0.6-1 
  
 === c. Changes to /​etc/​pam.d/​su === === c. Changes to /​etc/​pam.d/​su ===
Line 56: Line 38:
 === d. Verify === === d. Verify ===
  
-1. Enable cagefs for a user  +Enter into user's CageFS as root 
- +
-    su - username  +
-or +
     cagefsctl -e username     cagefsctl -e username
  
-2. Select ​PHP 5.3 binary in PHP selector for illustration ​ +In user's cagefs, verify ​PHP version: ​ 
-{{ http://i48.tinypic.com/2yz08qo.png?​700 ​|PHP Selector}}+  /usr/local/bin/lsphp -i more
  
-3. In user's cagefs, ​/​usr/​local/​bin/​lsphp should be a symlink to php53 (since we pick 5.3 in step 2.)+/​usr/​local/​bin/​lsphp should be a symlink to a php version specified by System Admin or user.
  
 +For example:
     lstestc@cptest [~]# ls -l /​usr/​local/​bin/​lsphp     lstestc@cptest [~]# ls -l /​usr/​local/​bin/​lsphp
     lrwxrwxrwx 1 root root 22 Mar 14 19:15 /​usr/​local/​bin/​lsphp -> /​etc/​cl.selector/​lsphp*     lrwxrwxrwx 1 root root 22 Mar 14 19:15 /​usr/​local/​bin/​lsphp -> /​etc/​cl.selector/​lsphp*
Line 73: Line 53:
     lstestc@cptest [~]#     lstestc@cptest [~]#
  
 +Please also refer to CloudLinux [[http://​docs.cloudlinux.com/​index.html?​cloudlinux_installation.html|document]] for installation details.
  
  
 ===== LiteSpeed Web Server Setting ===== ===== LiteSpeed Web Server Setting =====
  
-In lsphp5 external app (Admin Console => Configuration => Server => External App => lsphp5)+Configure php selector in LiteSpeed Web Server setting to enable it for LSWS: 
 + 
 +  - Enable CloudLinux CageFS support under **Admin Console => Configuration => Server => General => Cloud-Linux**,​ and select an applicable option, e.g., ''​CageFS''​ 
 +  - Enable **PHP suEXEC** under **Admin Console => Configuration => Using Apache Configuration File => PHP suEXEC**, set to ''​Yes''​ 
 +  - LSPHP5 external app runs in non-daemon mode ONLY (**Run On Start Up** => ''​Yes''​ or ''​No''​). Check [[litespeed_wiki:​php:​which_php_setup_am_i_using#​php_suexec_setups|here]] for Worker mode or ProcessGroup mode setup. 
 +  - In lsphp5 external app **Admin Console => Configuration => Server => External App => lsphp5**
  
 Change ​ Change ​
Line 94: Line 79:
 See screenshot below: See screenshot below:
  
-{{ http://​i45.tinypic.com/​34t5v0n.png?700 |LSWS LSPHP5 setting}}+{{:litespeed_wiki:​cloudlinux:​cloudlinux-php-selector.png|}}
  
  
  
-===== Notes =====+**Notes**: In order to use PHP Selector and custom php.ini, lsphp5 needs to be in **NON**-daemon mode( for example, Worker mode or ProcessGroup mode). As explained in this [[http://​blog.litespeedtech.com/​2012/​11/​29/​change-php-ini-under-php-suexec-daemon-mode-not-possible/​|blog]],​ php.ini can not be overridden in Daemon mode.
  
-1. In order to use PHP Selector and custom php.ini, lsphp5 needs to be in **NON** suEXEC daemon mode( for example, suEXEC worker mode or suEXEC process group mode). As explained in this [[http://​blog.litespeedtech.com/​2012/​11/​29/​change-php-ini-under-php-suexec-daemon-mode-not-possible/​|blog]],​ php.ini can not be overridden in suEXEC daemon mode. +**Configuration > Server > External App > lsphp5**
- +
-Admin Console => Configuration ​=> Server ​=> External App => lsphp5+
 <​code>​ <​code>​
 Run On Start Up => Yes or No Run On Start Up => Yes or No
 </​code>​ </​code>​
 +
 +You can also check [[http://​docs.cloudlinux.com/​index.html?​litespeed_support.html|Cloudlinux PHP Selector LiteSpeed Support]] documentation.
 +
  • Admin
  • Last modified: 2016/06/16 14:53
  • by Jackson Zhang