DirectAdmin and multiple PHP versions; feature changed?

HolyDiver

Verified User
Joined
Feb 21, 2016
Messages
51
I can't wrap my head around being able to run two PHP versions simultaneously and I'm not sure if the feature has changed or if I'm just unable to get it working like I want it to. According to screenshots on the Internet it did work some time ago (https://www.vultr.com/docs/using-multiple-php-versions-on-directadmin)

1.png


But it looks like this to me in DirectAdmin 1.59:

CJYnhHj.jpg


Changing the DA skin makes no difference. These are my CustomBuild settings:
php1_release=5.6
php1_mode=php-fpm
php2_release=7.3
php2_mode=php-fpm

The PHP instances are installed properly.
root@server:~# /usr/local/php56/bin/php -v
PHP 5.6.40 (cli) (built: Jan 13 2019 17:30:35)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

root@server:~# /usr/local/php73/bin/php -v
PHP 7.3.12 (cli) (built: Nov 23 2019 15:27:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies

The PHP instances are working properly.
root@server:~# service php-fpm56 status
● php-fpm56.service - The PHP FastCGI Process Manager
Loaded: loaded (/etc/systemd/system/php-fpm56.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2019-11-23 17:36:48 CET; 23min ago
Main PID: 22895 (php-fpm56)
Status: "Processes active: 0, idle: 1, Requests: 78, slow: 0, Traffic: 0.2req/sec"
Tasks: 2 (limit: 4915)
CGroup: /system.slice/php-fpm56.service
├─22895 php-fpm: master process (/usr/local/php56/etc/php-fpm.conf)
└─28888 php-fpm: pool holydiver

Nov 23 17:36:48 server.xxx.com systemd[1]: Starting The PHP FastCGI Process Manager...
Nov 23 17:36:48 server.xxx.com systemd[1]: Started The PHP FastCGI Process Manager.

root@server:~# service php-fpm73 status
● php-fpm73.service - The PHP FastCGI Process Manager
Loaded: loaded (/etc/systemd/system/php-fpm73.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2019-11-23 17:55:11 CET; 3min 31s ago
Main PID: 23935 (php-fpm73)
Status: "Processes active: 0, idle: 0, Requests: 0, slow: 0, Traffic: 0req/sec"
Tasks: 1 (limit: 4915)
CGroup: /system.slice/php-fpm73.service
└─23935 php-fpm: master process (/usr/local/php73/etc/php-fpm.conf)

Nov 23 17:55:11 server.xxx.com systemd[1]: Starting The PHP FastCGI Process Manager...
Nov 23 17:55:11 server.xxx.com systemd[1]: Started The PHP FastCGI Process Manager.

I can't find anything wrong, so it only makes sense if DirectAdmin might have changed the possibility of using a .php73 file for instance.

I need it for migrating my site to PHP 7+, so right now it doesn't matter if I need to prepend file extensions.
Or will I have more luck to change the PHP handling for a subdomain in my Nginx configuration?
 
Is the PHP version selector enabled on your box?
Code:
/usr/local/directadmin/directadmin c | grep php_version_selector
 
Thanks! I overlooked that option since it wasn't explicitly declared in my directadmin.conf file. Coincidentally your answer made me stumble to this page: https://www.directadmin.com/features.php?id=2243

please let us know.. as the current plan is to remove the 2nd php version instance from the templates, since it's likely not needed, and very rarely used.

It seems like this already has been done, since changing php_version_selector did nothing for me unfortunately. But I got it working with a temporary change in my Nginx config (running a front controller so only one file needs a .php73 extension).

Code:
location ~ \.php73$
{
    [...]
    fastcgi_pass unix:/usr/local/php73/sockets/|USER|.sock;
}

EDIT: after rebuilding php the second php selector showed up
 
Last edited:
Back
Top