Set Default Version
In ServBay, you can set the default version for command-line support to use by default when running command lines or related scripts. This supports PHP, Nodejs, MariaDB, PostgreSQL, and more. Here are the detailed instructions for setting the default version:
- Open ServBay and click on "Settings" in the left navigation bar.
- On the settings page, locate the "Default Version" option.
- In the dropdown options, select the default versions for PHP, Nodejs, MariaDB, and PostgreSQL respectively.
- Click the "Apply" button to apply the changes.
After setting the default version, for example, if you set the default PHP version to 7.4, running php -v
in the command line will output PHP 7.4.x (cli)
.
If you need to temporarily execute a non-default version in the command line, such as PHP 8.1, you can use the php-8.1
command to call version 8.1, like php-8.1 -v
, which will output PHP 8.1.x (cli)
.
Similar settings apply to MariaDB, PostgreSQL, and other packages. Please note that on the service management page, you can see a fixed icon next to the service name indicating that this version is set as the default.