PHP

php:ini

Get or set PHP config directive for the currently active PHP version

Syntax

box php:ini [-l|--list-files] [--] [<key>] [<value>]

To retrieve a value from the currently installed PHP version, you can use the box php:ini <directive> command. For example, to get the current mysql.default_socket value:

box php:ini mysql.default_socket

To change this value into something else, append the new value:

box php:ini mysql.default_socket /path/to/new/socket

The script puts these directives into an additional config file that overrides the default values. To remove the directive again, pass in an empty value:

box php:ini mysql.default_socket ""

If you want to get the list of the scanned .ini files, run the command without arguments:

box php:ini

Arguments

key

Name of the directive to lookup or update

value

New value

Options

--list-files , -l

php:list

List all installed PHP versions

Syntax

box php:list

To get a list of the PHP versions you have build and installed, run:

box php:list

Use the box php:use <VERSION> command to switch to one of the available versions.

php:remove

Uninstall a custom PHP version

Syntax

box php:remove <version>

Arguments

version

PHP version to remove

php:reset

Switch back to the default system PHP

Syntax

box php:reset

php:use

Switch to another PHP version. Will attempt to compile from source if not installed.

Syntax

box php:use <version>

You can build and install any PHP version from 5.2.0 and up automatically. This is ideal to try out your code on new PHP releases or to fix bugs that have been reported on older PHP versions. To install one of the available versions, for example 7.0.0RC6, execute:

box php:use 7.0.0RC6

The script will check if this version has been installed and if not, will attempt to build it. Please note that building PHP might take a while.

You can get a list of buildable versions using the box php:versions command. To see what is already compiled and available, use the box php:list command.

To revert back to the default PHP installation, run box php:reset.

The truly adventurous can build the current master branch with this command: box php:use master. Each time you build the master branch the script will pull in the latest changes from the PHP Git repository.

Arguments

version

PHP version to remove

php:versions

List all available versions

Syntax

box php:versions

To get a list of the PHP versions you can build and install, run this command:

box php:versions

Use the box php:use <VERSION> command to build and install one of the available versions.