This is an old revision of the document!


How to set to use CloudLinux PHP Selector instead of EA4 multi-PHP on cPanel EA4 + CloudLinux + LSWS?

If you use cpanel EA4 on CloudLinux system, when installing LSWS, LiteSpeed auto-installer script will add proper external apps for both EA4 muli-PHP and CloudLinux PHP Selector automatically, while php handlers will be set to use EA4-Multi-PHP by default with version 5.6.

The external apps are as the following:

External app lsphp56:

External app cl_phpselector:

PHP Handlers:

Suffix .php and .php5 will be set to handled by lsphp56 by default. If you want to use CloudLinux PHP Selector, you should change suffix .php and .php5 to be handled by cl_phpselector.

As you have already know, when CloudLinux integrated with cpanel Easy Apache 4, how the php version being selected. Only when cpanel multi PHP version for a domain is the same as cpanel system default php version(which was set from the very beginning) , then CloudLinux PHP selector will be used, see detailed here.

For example, cpanel system PHP version default version is ea-php56, for example1.com, Multi-PHP manager is set to ea-php56. Then .htaccess in example1.com document root will be added the following by cpanel:

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
 AddType application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

If you want to use CL PHP selector 7.0, How do you do? While , you don't worry about “AddType application/x-httpd-ea-php56” in .htaccess. You really need to understand how CloudLinux PHP Selector works with cpanel EA4. In this case, you just need to check what CloudLinux php selecter set for this account. If CL php selecter is set to native, then cpanel EA4 Multi PHP version used. If CL php selector Version other than native used, then web server will use CL PHP selector version.

we run the following command to check example1 user:

/usr/bin/cl-selector --summary php --user example1
5.1 e - -
5.2 e - -
5.3 e - -
5.4 e - -
5.5 e - -
5.6 e - -
4.4 e - -
7.0 e - -
7.1 e - -
native e d s

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

To verify,

/usr/bin/cl-selector --summary php --user example1
5.1 e - -
5.2 e - -
5.3 e - -
5.4 e - -
5.5 e - -
5.6 e - -
4.4 e - -
7.0 e - s
7.1 e - -
native e d -

You should be able to see CL-PHP selector 7.0 is used at php info page http://example1.com/phpinfo.php .

  • Admin
  • Last modified: 2017/10/20 21:23
  • by Jackson Zhang