Adding PHP to your Project
Rundevbox add php php83Packages.composer
, or add the following to your devbox.json
:
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 topackages
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 php83Extensions.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 withdevbox add
. You can also manually add the PHP plugin by adding plugin:php
to your include
list
in devbox.json
:
Services
- php-fpm
devbox services start|stop php-fpm
to start PHP-FPM in the background.
Environment Variables
Helper Files
- {PROJECT_DIR}/devbox.d/php81/php-fpm.conf
- {PROJECT_DIR}/devbox.d/php81/php.ini
Disabling the PHP Plugin
You can disable the PHP plugin by runningdevbox add php --disable-plugin
, or by setting the
disable_plugin
field in your devbox.json
: