DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

Up to 4 php versions in DirectAdmin

| 00:16:37 26.01.2019

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.

PHP selector in Directadmin can now support up to 4 PHP versions.

Requirements

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.

Insights

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.


Installation

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

PHP selector

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).

PHP selector in Directadmin can now support up to 4 PHP versions.

That's it.

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition