PHP projects can manage most of their dependencies locally with
composer. Some PHP extensions, however, need to be bundled with PHP at compile time.
Adding PHP to your Project
devbox add php php81Packages.composer, or add the following to your
If you want a different version of PHP for your project, you can search for available versions by running
devbox search php. You can also view the available versions on Nixhub
Installing PHP Extensions
You can compile additional extensions into PHP by adding them to
packages in your
devbox.json. Devbox will automatically ensure that your extensions are included in PHP at compile time.
For example -- to add the
ds extension, run
devbox add php81Extensions.ds, or update your packages to include the following:
PHP Plugin Details
The PHP Plugin will provide the following configuration when you install a PHP runtime with
devbox add. You can also manually add the PHP plugin by adding
plugin:php to your
includes list in
devbox services start|stop php-fpm to start PHP-FPM in the background.
You can modify these files to configure PHP or your PHP-FPM server