Skip to content
Sergei Morozov edited this page Dec 18, 2019 · 2 revisions

System interpreter is the PHPBrew feature that allows you to always use the same PHP interpreter to run the PHPBrew logic regardless of which PHP version is currently used.

Why?

As any application, PHPBrew has its own runtime requirements. As for PHP, right now it requires PHP 5.3 with a certain set of extensions. Without using the system interpreter, if you are using a PHP version that PHPBrew is incompatible with, PHPBrew won't work.

Soon, PHPBrew will bump its PHP version requirement to 7.2, so if you want to keep using it with an old PHP version, you'll have to specify the system interpreter.

How?

By default, the system interpreter is not set which means that PHPBrew will use whatever version chosen by phpbrew use.

In order to set the system interpreter, use the phpbrew system <version> command. The <version> argument may either a PHP build name or the absolute path to the interpreter:

$ phpbrew system 7.4.0           # or
$ phpbrew system my-system-build # or
$ phpbrew system /usr/bin/php

Note that only a PHP version that meets the PHPBrew requirements can be chosen as the system interpreter:

$ phpbrew system 7.1.33
Only PHP 7.2.0 or newer can be used as PHPBrew interpreter

In order to get the currently used interpreter, use phpbrew system. For instance:

$ phpbrew system
/home/morozov/.phpbrew/php/php-7.4.0/bin/php

Note that the output of the command above will always contain the absolute path to the interpreter regardless of whether it was set using the build name or the absolute path. If there's no system interpreter set, the output is empty.

In order to switch off the system interpreter, use phpbrew system-off.

Clone this wiki locally