Up to 4 PHP versions can now be supported by Directadmin from a box. No need to use 3rd party addons, customization, or whatever else. Just update Directadmin and Custombuild versions to the latest and get the new feature ready to be used.
The feature is available in Directadmin since the version 1.55.1. So first make sure you've got it, or use a pre-release (beta) version, compiled after Jan 26 2019.
CustomBuild 2 should be at least of 1994 revision.
An installation process is as simple as before and does not require anything specific. Custombuild options file will get new lines:
php3_release=no php3_mode=php-fpm php4_release=no php4_mode=php-fpm
You can adjust them to fit your needs directly in options.conf or using ./build script.
Here are details on possible values supported at the moment:
php1_release: 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3. Current value: 7.2. Default value: 7.2. php1_mode: php-fpm, fastcgi, suphp, lsphp, mod_php. Current value: php-fpm. Default value: mod_php. php2_release: 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, no. Current value: 7.1. Default value: no. php2_mode: php-fpm, fastcgi, suphp, lsphp. Current value: php-fpm. Default value: php-fpm. php3_release: 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, no. Current value: 5.6. Default value: no. php3_mode: php-fpm, fastcgi, suphp, lsphp. Current value: php-fpm. Default value: php-fpm. php4_release: 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, no. Current value: 5.4. Default value: no. php4_mode: php-fpm, fastcgi, suphp, lsphp. Current value: php-fpm. Default value: php-fpm.
Let's say we want to have PHP 5.6 as the third PHP version, and PHP 5.4. as the fourth PHP version; the both will be used as PHP-FPM.
Here we go:
cd /usr/local/directadmin/custombuild ./build update
Run the following commands to set PHP release 3 to PHP-FPM 5.6:
./build set php3_release 5.6 ./build set php3_mode php-fpm
Run to set PHP release 4 to PHP-FPM 5.4:
./build set php4_release 5.4 ./build set php4_mode php-fpm
and then compile all PHP versions
./build php
If everything went fine and a compilation completed fine
Restarting php-fpm72. Restarting php-fpm71. Restarting php-fpm56. Restarting php-fpm54.
you will get 4 PHP-FPM instances running:
# ps ax | grep php 29213 ? Ss 0:00 php-fpm: master process (/usr/local/php72/etc/php-fpm.conf) 29224 ? Ss 0:00 php-fpm: master process (/usr/local/php71/etc/php-fpm.conf) 29234 ? Ss 0:00 php-fpm: master process (/usr/local/php56/etc/php-fpm.conf) 29244 ? Ss 0:00 php-fpm: master process (/usr/local/php54/etc/php-fpm.conf)
Check options and see
PHP (default): 7.2 as php-fpm PHP (additional): 7.1 as php-fpm PHP (additional): 5.6 as php-fpm PHP (additional): 5.4 as php-fpm
Now it's time to connect to Directadmin at user level. A PHP selector should now show 4 PHP versions (a screenshot down below is taken from an Evolution skin).
That's it.