Command Line Support
ServBay provides command line support, allowing you to install the ServBay command line tool in bash or zsh. Here are the installation steps:
- Open ServBay and click on
Settings
in the left navigation bar.
- On the settings page, locate the
Command Line Tool
option. - Depending on your terminal environment, click
Install CLI Tool to zsh
orInstall CLI Tool to bash
.
- Once the installation is complete, reopen your terminal and the command line tool will take effect.
Setting Default Package Versions
If you want to set the default software versions, such as the default PHP, Node.js, MySQL, or MariaDB service versions, you can refer to the Set Default Version document for detailed steps.
Specify Command Line for Specific Versions in Projects
ServBay supports project-level configurations for PHP/Node.js runtime environments, which is accomplished using the .servbay.config
file. Through the .servbay.config
file, you can specify particular versions of PHP and Node.js as the default command line versions for the current project, and customize project-level settings for Node.js runtime versions, repository addresses, cache directories, etc.
For detailed setup and usage methods, please refer to the article Using the .servbay.config File.
Running Specific Versions of PHP
ServBay supports the direct execution of specific versions of PHP, such as php-5.6
or phpize-8.3
. You can use these commands in the terminal to execute operations with specific versions of PHP.
Example Commands
- Check Current Installed PHP Version:
php -v
- Run PHP Script with PHP 5.6:
php-5.6 your_script.php
- Connect to PostgreSQL Database:
psql -h localhost -U your_user -d your_database
- Execute SQL Query:
psql -h localhost -U your_user -d your_database -c "SELECT * FROM your_table;"
- Check Redis Status:
redis-cli info stats
With these example commands, you can leverage the various services provided by ServBay in your command line environment.