Adding PHP Extensions
Nitro is no longer supported. Please see our announcement and DDEV migration guide.
The Docker images Nitro use the craftcms/nginx:<php-version>-dev
(opens new window). These images are preconfigured with the PHP extensions required for Craft CMS and Commerce. However, there are times you may need to install additional extensions for a site.
To enable an extension for a site, run the following command:
$ nitro extensions
Select a site:
1. craft-support.nitro
2. another-site.nitro
3. plugins-dev.nitro
4. tutorial.nitro
Enter your selection: 1
Which PHP extension would you like to enable for craft-support.nitro?
1. bcmath
2. bz2
3. calendar
4. dba
5. enchant
...
Enter your selection: 1
Apply changes now [Y/n] #
The additonal PHP extension will now be stored on your nitro.yaml
file underneath the sites PHP version
setting:
// removed for brevity
sites:
- hostname: craft-support.nitro
aliases:
- support.nitro
path: ~/dev/support
version: "7.3"
extensions:
- calendar
webroot: craft-support/web
xdebug: true
# Supported Extensions
The following extensions are available for installation:
- bcmath
- bz2
- calendar
- dba
- enchant
- exif
- gettext
- gmp
- imap
- interbase
- ldap
- mysqli
- oci8
- odbc
- pcntl
- pdo_dblib
- pdo_firebird
- pdo_oci
- pdo_odbc
- pdo_sqlite
- recode
- shmop
- snmp
- sockets
- sysvmsg
- sysvsem
- sysvshm
- tidy
- wddx
- xmlrpc
- xsl
- zend_test