Using rdev

PHP extensions

rdev's PHP comes with the extensions most projects need: among them bcmath, gd, imagick, intl, mbstring, pdo_mysql, pdo_pgsql, redis, apcu, soap, sodium, swoole and zip. Run php -m on the server for the full list. Extensions that are not built in are installed from rdev's own catalog with one command.

Install an extension

In the panel, open the server from Servers in the sidebar. The PHP card lists each installed PHP version, which one is the default, the extensions added to it and the modules it loads. Add extension installs one from the catalog for the version you choose, and the × on an added extension removes it. The server does it within seconds; this needs rdev 0.2.0-beta.24 or later.

On the server:

rdev php ext install mongodb

This installs the extension for your default PHP version. To choose the version, add --php:

rdev php ext install xdebug --php 8.3

rdev downloads a build made for that PHP version and your server's processor, checks its signature and checksum, makes sure PHP loads it, then turns it on for both the web server and the command line. Nothing is compiled on your server. A site on another PHP version needs the extension installed for that version too. Your default version is the one rdev use 8.4 sets.

Extension PHP versions Notes
mongodb 8.1 – 8.5 The MongoDB driver that the mongodb/mongodb and mongodb/laravel-mongodb packages need; use it with the MongoDB service.
xdebug 7.4 – 8.5 Step debugging and profiling. It installs switched off, so it does not slow your sites; turn it on with rdev php ini set 8.4 xdebug.mode debug.

More extensions are coming. If your project needs one that is missing, tell us.

See and remove extensions

rdev php ext list
rdev php ext remove 8.4 mongodb

list shows what is installed for each PHP version. remove turns an extension off for that version.

Your own build

If you have built an extension yourself, register its .so for a PHP version:

rdev php ext add 8.4 /home/dev/ext/scrypt.so

Add --zend for a Zend extension, the way Xdebug and OPcache load. rdev refuses an extension that fails to load into that PHP version.