Integrating With Control Panels

Navigation:  PHP Selector > Command Line Tools >

Integrating With Control Panels

Previous pageReturn to chapter overviewNext page

This is a list of commands that we are using to integrate PHP Selector with control panels. If you need to integrate with custom control panel, you might find all the commands here:

 

PHP summary:

 

/usr/bin/cl-selector --summary=php

 

Result:

5.1 - -

5.2 e -

5.3 e d

5.4 e -

5.5 e -

4.4 e -

native - -

 

First column: php version

Second: enabled or not (e -- enabled)

Third: if selected as default  (d -- default)

 

Set default version:

/usr/bin/sudo /usr/bin/cl-selector --interpreter=php --version=_VERSION_

 

Disable version

/usr/bin/cl-selector --interpreter=php --set-disabled=_VERSION_

 

Enable version

/usr/bin/cl-selector --interpreter=php --set-enabled=_VERSION_

 

List Extensions for a version:

/usr/bin/cl-selector --list-extensions=php --version=5.2

 

Result:

- apc

- bcmath

- big_int

- bitset

- bloomy

~ bz2

- bz2_filter

~ calendar

- coin_acceptor

- crack

~ ctype

+ curl

 

+ -- enabled

~ -- included in php binary (cannot be disabled)

- -- disabled

 

Update Default Extensions:

/usr/bin/cl-selector --interpreter=php --version=_VERSION_ --update-default-extensions=EXT_LIST

 

EXT_LIST is comma separated list of PHP extensions to be enabled by default for this version

 

Select PHP version for a user:

/usr/bin/cl-selector --select=php --version=_VERSION_ --user=_USER_

 

List Enabled extensions for a user:

cl-selector --list-extensions=php --version=_VERSION_ --user=_USER_ --all

 

Reset user’s extensions to defaults:

/usr/bin/cl-selector --set-default-extensions=php --user=_USER_ --version=_VERSION_

 

Update extensions for the user:

/usr/bin/cl-selector --interpreter=php --update=EXT_LIST --user=_USER_ --version=_VERSION_ --with-reload --backup

 

EXT_LIST is comma separated list of PHP extensions to be enabled by default for this version

 

List available options for php.ini editing:

/usr/bin/piniset --version=_VERSION_ --user=_USER_ [--json]

 

Set php.ini options for end user:

/usr/bin/piniset --version=_VERSION_ --user=_USER_ --replace=OPTIONS --base64

 

Here is an example how you can generate OPTIONS in base64 format:

OPTIONS=`echo disable_functions:exec,syslog|base64 -w 0`,`echo display_errors:off|base64 -w 0`,`echo post_max_size:128M|base64 -w 0`

echo $OPTIONS