Using .servbay.config File
Overview
ServBay supports project-level runtime environment configuration, which is achieved by creating a .servbay.config
file in the project directory.
Through the .servbay.config
file, users can configure different runtime environments for each project, such as specifying the runtime versions for PHP and Node.js. This capability grants users complete control over their projects while greatly enhancing convenience.
Additionally, .servbay.config
also supports configuring the NPM and Yarn repository addresses as well as the cache directory for Node.js.
How to Set Up .servbay.config
Here is an example configuration of a .servbay.config
file. In this example, the PHP runtime version is set to PHP 8.5 and the Node.js runtime version is set to Node.js 20. It also specifies the mirror addresses for NPM and Yarn as https://npmreg.proxy.ustclug.org/
, and the NPM cache directory address as /Applications/ServBay/tmp/npm/cache
PHP_VERSION=8.5
NODE_VERSION=20
YARN_CONFIG_REGISTRY=https://npmreg.proxy.ustclug.org/
NPM_CONFIG_REGISTRY=https://npmreg.proxy.ustclug.org/
NPM_CONFIG_CACHE=/Applications/ServBay/tmp/npm/cache
2
3
4
5
Running Example
Below is a practical example demonstrating the operation mechanism of .servbay.config
.