This is an old revision of the document!


Configuring cPanel EA4 + CloudLinux + LSWS to Use CloudLinux PHP Selector Instead of EA4 Multi-PHP

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

The following external apps are installed:

External app lsphp56:

External app cl_phpselector:

PHP Handlers:

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

As you may know, when CloudLinux is integrated with cPanel Easy Apache 4, the CloudLinux PHP Selector will only be used if the cPanel Multi-PHP version for a domain is the same as the cPanel system default PHP version, which was set from the very beginning. (See the cPanel documentation for further details.)

For example, say the cPanel system PHP default version is ea-php56 for example1.com, and Multi-PHP manager is set to ea-php56. Then cPanel will add the following to the .htaccess in example1.com's document root:

# 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

So, what do you do if you want to use CL PHP Selector 7.0 (for example)?

It's important to understand how the CloudLinux PHP Selector works with cPanel EA4. In this case, you just need to check which CloudLinux PHP Selector is set for this account. If CL PHP Selector is set to native, then cPanel EA4 Multi-PHP version is used. If a CL PHP Selector version other than native is used, then the web server will use the CL PHP Selector version chosen.

There's no need to worry about AddType application/x-httpd-ea-php56 in the .htaccess file. It will be overridden by the CloudLinux PHP Selector setting.

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 -

Check the PHP Info page, and you should see CL PHP Selector 7.0 is in use.

  • Admin
  • Last modified: 2017/10/23 14:24
  • by Lisa Clarke