Setting the Default Version
ServBay allows you to set default versions for packages that support the Command Line Interface (CLI), as well as configure which SQL database server and version start by default. This is especially helpful for managing different languages or tools required by various projects and ensures that your expected version is used by default when called in the terminal or scripts.
Configure the Default Command-Line Version for ServBay Packages
In ServBay, you can set a default version for packages like PHP, Node.js, MariaDB, MySQL, PostgreSQL, and MongoDB, making sure that this version is used by default when called in the terminal or from scripts. Here’s how to set the default version:
Open the ServBay application.
Click "Settings" in the left-hand sidebar.
On the Settings page, find the "Default Version" section.
Use the dropdown menus to select your preferred default version for PHP, Node.js, MariaDB, MySQL, PostgreSQL, and MongoDB.
Click the "Apply" button at the bottom of the page to save your changes.
Once you have set the default version, for example, if you designate PHP 7.4 as the default, running the php -v
command in your terminal will show PHP 7.4.x (cli)
.
If you need to temporarily use a non-default version in the terminal (such as PHP 8.1), simply run the specific versioned command like php-8.1 -v
, which will display PHP 8.1.x (cli)
. This lets you run a particular version of a command or script without changing the global default.
This setup works the same way for Node.js, MariaDB, PostgreSQL, and MongoDB packages. On the Service and Package Management page, you’ll see a pin icon beside the name of the package that is currently set as default, indicating the selected version.
Setting the Default SQL Database Server and Version (MySQL/MariaDB)
Since MySQL and MariaDB are both SQL databases and typically use the same network port (e.g., 3306) and socket file, they cannot run at the same time. ServBay makes it easy to choose which SQL database type (MySQL or MariaDB) and version to start by default, allowing you to quickly switch between them to suit different project requirements.
For example, if you are currently running MariaDB 11.4 and want to switch to MySQL 9.0 as the default database when ServBay starts:
Open the “Settings” page in ServBay.
Scroll down to the “Default SQL Server” section.
In the “Default SQL Server” dropdown menu, select
MySQL
, then click the adjacent "Apply" button. (This sets ServBay to start MySQL by default when launching.)In the “Default Version” dropdown next to it, select the specific version of MySQL you want as default (such as
MySQL 9.0
), then click the adjacent "Apply" button. (This determines which version of MySQL is started by default.)You're all set. The next time ServBay starts, it will launch your selected SQL database server and version by default.
With this method, you can quickly switch the default database type and version whenever needed, without manually stopping and starting different database services.