PHP Selector without CageFS

Navigation:  PHP Selector >

PHP Selector without CageFS

Previous pageReturn to chapter overviewNext page

[Requires LVE Manager 2.0-11.1 or higher]

 

PHP Selector can now be used with CageFS turned off (in case when there is only one user account on the server).

 

To install run:

 

yum groupinstall alt-php

yum install cagefs lvemanager

 

(no need to initialize or turn on CageFS)

 

selectorctl --setup-without-cagefs USER

 

(USER - the name of a user who is using selector. If not specified, the first available cPanel account username will be used).

 

When executing --setup-without-cagefs, the following actions are performed:

 

Creating symlinks to the user modules and options for each Alt-PHP version:

 

/opt/alt/php55/link/conf/alt_php.ini -> /home/USER/.cl.selector/alt_php55.ini

 

In user home directory creating:

 

.cl.selector/

“Backup” settings files (selected version, modules, options):

.cl.selector/defaults.cfg

.cl.selector/alt_php44.cfg

Symlinks to the selected version:

.cl.selector/lsphp -> /opt/alt/php44/usr/bin/lsphp

.cl.selector/php.ini -> /opt/alt/php44/etc/php.ini

.cl.selector/php-cli -> /opt/alt/php44/usr/bin/php

.cl.selector/php -> /opt/alt/php44/usr/bin/php-cgi

Additional symlinks for environment variable $PATH (search path) in the file ~/.bashrc:

.cl.selector/selector.path/

.cl.selector/selector.path/php-cgi -> ../php

.cl.selector/selector.path/php -> ../php-cli

Generated ini files with selected modules and options for each version:

.cl.selector/alt_php44.ini

.cl.selector/alt_php51.ini

.cl.selector/alt_php52.ini

.cl.selector/alt_php53.ini

.cl.selector/alt_php54.ini

.cl.selector/alt_php55.ini

.cl.selector/alt_php56.ini

.cl.selector/alt_php70.ini

.cl.selector/alt_php71.ini

 

Symlinks above are being created according to the settings in ~/.cl.selector/defaults.cfg and ~/.cl.selector/alt_php44.cfg files (44 - corresponding PHP version), which are storing PHP Selector settings for the user. These files are usually taken from user home directory backup or when migrating account from another server. Thus, when migrating account from server to server, PHP Selector settings are saved.

 

If no PHP Selector settings backup files are found when running selectorctl --setup-without-cagefs, then default settings from /etc/cl.selector/defaults.cfg global file are applied (as in selector normal mode). If the file is absent, then native PHP version will be selected for the user.

 

The following line: PATH=$HOME/.cl.selector/selector.path:$HOME/.cl.selector:$PATH

 

is being added to the user file ~/.bashrc

 

Apache PHP handlers settings are not changed.

 

Also selectorctl --setup-without-cagefs command does the following:

 

oTurns off link traversal protection (linksafe);

oTurns off cagefs service.

 

To get back to the selector normal mode (“with CageFS”) run:

 

selectorctl --revert-to-cagefs

 

(CageFS should be initialized by using “cagefsctl --init” command before running the command above)

 

This command removes symlinks:

 

/opt/alt/php55/link/conf/alt_php.ini -> /home/USER/.cl.selector/alt_php55.ini, turns on link traversal protection (linksafe) and cagefs service.