Informational Website publish

Blog

News about our company, tutorials about IT and much more you will find in this page.

DirectAdmin – Setting up multiple PHP versions

Maio 13th, 2020

1. Go to DirectAdmin custombuild folder:

cd /usr/local/directadmin/custombuild

2. Change the CustomBuild configuration for it to allow several PHP versions. It can be done by changing the “options.conf” file or using SSH and command line. While you still are in the CustomBuild folder, change the required options:

./build set php1_mode php-fpm
./build set php2_mode php-fpm
./build set php1_release 7.3
./build set php2_release 7.0

3. Open the “options.conf” file:

Check if the lines are as seen bellow:

php1_release=7.3
php1_mode=php-fpm
php2_release=7.0
php2_mode=php-fpm

4. Recompile PHP (it will take a while):

./build php n

5. Update the configuration:

./build rewrite_confs

Now you will be able to change the PHP versions for each domain inside the DirectAdmin control panel. 

By default, all the websites on your control panel will be using the “php1_release” set PHP version.

If you want to change the PHP version for the specific website, login into your DirectAdmin control panel, press on the “User Level” and select the domain. Then click on “Domain Setup” and on the bottom, you will see a possibility to select the wanted PHP version.