Integrating With Control Panels

Navigation:  PHP Selector > Command Line Tools >

Integrating With Control Panels

Previous pageReturn to chapter overviewNext page

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

 

PHP summary:

 

Command:

 

/usr/bin/selectorctl --summary

 

Result:

 

4.4 e -

5.1 e -

5.2 e -

5.3 e -

5.4 e -

5.5 e -

5.6 e -

7.0 e -

7.1 e -

native e d

 

When native PHP version needs to be displayed:

 

Command:

 

/usr/bin/selectorctl --summary --show-native-version

 

Result:

 

4.4 e -

5.1 e -

5.2 e -

5.3 e -

5.4 e -

5.5 e -

5.6 e -

7.0 e -

7.1 e -

native(5.6) e d

 

The first column: PHP version

The second column: enabled or not (e - enabled)

The third column: if selected as default  (d - default)

 

Set default version:

 

/usr/bin/selectorctl --set-current=_VERSION_

 

Disable version:

 

/usr/bin/selectorctl --disable-alternative=_VERSION_

 

Enable version:

 

/usr/bin/selectorctl --enable-alternative=_VERSION_

 

List Extensions for a version:

 

/usr/bin/selectorctl --list-extensions --version=5.6

 

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

 

Select Default Extensions (enable comma-separated list of extensions globally for a version):

 

/usr/bin/selectorctl --version=5.6 --enable-extensions=pdo,json,mysql

 

Deselect Default Extensions (disable comma-separated list of extensions globally for a version):

 

/usr/bin/selectorctl --version=5.6 --disable-extensions=pdo,json,mysql

 

Replace extensions with comma-separated list of extensions for a version globally:

 

/usr/bin/selectorctl --version=5.6 --replace-extensions=pdo,json,mysql

 

Select PHP version for a user:

 

/usr/bin/selectorctl --set-user-current=_VERSION_ --user=_USER_

 

List Enabled extensions for a user:

 

/usr/bin/selectorctl --list-user-extensions --user=_USER_ --version=_VERSION_

 

Enable comma-separated list of extensions for a user:

 

/usr/bin/selectorctl --enable-user-extensions=pdo,json,mysql --user=_USER_ --version=_VERSION_

 

Reset user’s extensions to defaults:

 

/usr/bin/selectorctl --reset-user-extensions --user=_USER_ --version=_VERSION_

 

Replace user extensions with comma-separated list of extensions:

 

/usr/bin/selectorctl --replace-user-extensions=EXT_LIST --user=_USER_ --version=_VERSION_

 

EXT_LIST is comma separated list of PHP extensions (for example: pdo,json,mysql)

 

List available options for php.ini editing:

 

/usr/bin/selectorctl --print-options --user=_USER_ --version=_VERSION_ [--json]

 

List available options for php.ini editing (print safe strings):

 

/usr/bin/selectorctl --print-options-safe --user=_USER_ --version=_VERSION_ [--json]

 

Set php.ini options for end user:

 

/usr/bin/selectorctl --user=_USER_ --version=_VERSION_ --replace-options=_OPTIONS_ --base64 [--json]

 

Here is an example of 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