PHP version select with Directadmin

Choosing and enabling multiple PHP versions with the selector in the Directadmin panel.

Directadmin PHP select

Directadmin allows up to 4 active PHP versions to be used and chosen from. The first listed is default and the rest will be options.

Navigate to Directadmin custombuild directory

cd /usr/local/directadmin/custombuild

Update or check for updates to Directadmin

./build update

Now choose the 4 PHP versions you want to use:

./build set php1_release 7.1
./build set php2_release 7.3
./build set php3_release 7.4
./build set php4_release 8.0

I am going to be doing it sequentially for this post, remember the first listed (php1_release) is the default.

If you don’t want 4 options use “no” e.g

./build set php4_release no

Now set the mode as php-fpm

./build set php1_mode php-fpm
./build set php2_mode php-fpm
./build set php3_mode php-fpm
./build set php4_mode php-fpm

Rebuild PHP

./build php n

And the rewrite configurations

./build rewrite_confs

The PHP version select option is enabled by default, to make sure it is enabled:

/usr/local/directadmin/directadmin set php_version_selector 1 restart

Now in modify domains the users have the PHP version selector.