This is an old revision of the document!


How to configure CloudLinux PHP Selector native version for CPanel and LiteSpeed

When you install CloudLinux PHP Selecor, along with CloudLinux alternative-phpxx, there is a native mode. Alternative php bianaries are installed to /opt/alt/phpxx/use/local/bin/php or lsphp, while /usr/local/bin/php or lsphp would be the native version.

For cpanel easy apache 3, they were normally build through easy apache. The lsphp was normally build for matching php and copied over to /usr/local/bin/lsphp.

For cpanel easy apache 4, they were normally copied over from cpanel ea-phpxx package. For example, if a default php is 5.6, /usr/local/bin/php should be copied from /opt/cpanel/ea-php56/root/usr/bin/php, then /usr/local/bin/lsphp should be copied from /opt/cpanel/ea-php56/root/usr/bin/lsphp for matching php.

To verify if the native version works or not and which php modules enabled, simply run:

/usr/local/bin/php -i | more
/usr/local/bin/lsphp -i | more

But not done yet, you have to check if native version has been enabled for use.

[~]#  selectorctl --summary --show-native-version
4.4 e -
5.1 e -
5.2 e -
5.3 e -
5.4 e -
5.5 e d
5.6 e -
7.0 e -
native(5.4) - -

There is no “e” after “native(5.4)” hence it is not enabled yet. To enable it:

 #/usr/bin/cl-selector --interpreter=php --set-enabled=native

Verify:

 selectorctl --summary --show-native-version
 4.4 e -
 5.1 e -
 5.2 e -
 5.3 e -
 5.4 e -
 5.5 e d
 5.6 e -
 7.0 e -
 native(5.4) e -

For example, a domain was set to use native but showed error:“Your PHP installation appears to be missing the MySQL extension which is required by WordPress.” It showed the same error for both Apache and LiteSpeed.

Check litespeed setting based on this reference, it seems all fine.

Check the native version:

 
/usr/local/bin/php -i | more
/usr/local/bin/lsphp -i | more

Both showed mysql module enabled.

However, native version was disabled in CloudLinux PHP selector. Enabling it will clear the error.

  • Admin
  • Last modified: 2016/06/17 21:08
  • by Jackson Zhang