Command Line Support
ServBay provides command line support, allowing you to install the ServBay command line tools in either bash or zsh. Here are the installation steps:
- Open ServBay, click on
Settings
in the left navigation bar.
- On the settings page, find the
Command Line Tools
option. - According to your terminal environment, click
Install cli tools to zsh
orInstall cli tools to bash
.
- After installation, reopen your terminal, and the command line tools will take effect.
Setting Default Package Versions
If you want to set default software versions, such as the default PHP or MariaDB version, you can refer to the Set Default CLI Version document for detailed steps.
Running Specific PHP Versions
ServBay supports running specific versions of PHP directly, such as php-5.6
or phpize-8.3
. You can use these commands in the terminal to execute operations with the specific PHP versions.
Example Commands
- View Current Installed PHP Version:
bash
php -v
1
- Run PHP Scripts with PHP 5.6:
bash
php-5.6 your_script.php
1
- Connect to PostgreSQL Database:
bash
psql -h localhost -U your_user -d your_database
1
- Execute SQL Query:
bash
psql -h localhost -U your_user -d your_database -c "SELECT * FROM your_table;"
1
- Check Redis Status:
bash
redis-cli info stats
1
Using these example commands, you can utilize various services provided by ServBay in the command line environment.