PHP version config for server virtualhost

haywardweb

Verified User
Joined
Jan 12, 2005
Messages
21
Location
WA
I have PHP 5.6 and 7.4 installed via these options:
Code:
php1_release=5.6
php1_mode=php-fpm
php2_release=7.4
phpmyadmin=yes
This server has a bunch of older sites that still require 5.6, so that is the php1_release.

Directadmin links to phpMyAdmin at https://{serverfqdn}/phpmyadmin. When I access this I get:
PHP 7.2.5+ is required.

Currently installed version is: 5.6.40
How do I select php2 (7.4) for {serverfqdn}? This is the server domain and doesn't belong to any user, so the documented way of selecting an alternative php installation for a user isn't available.
 
How do I select php2 (7.4) for {serverfqdn}?
You don't. Server is always php1_release.
PHP 7.4 is EOL, best is to use 8.0. However, you can set php1_release to 7.4 if you still want to use that. Then your server issues should be over for the time being.

If you have a bunch of older sites using php 5.6 and you want to keep supporting them, set php 5.6 to php2.
Just switch them.

It's easy to switch and you can also easily switch the accounts which require this to php2_release.
 
Makes sense. I'll swap things around. Thanks.

Edit: Went smoothly.

First I used the script here to switch all users to #4 (php1_select=4): https://docs.directadmin.com/webservices/php/multiple-php.html#swapping-all-users-php-selection

Then I ran:
Code:
./build set php1_release 8.0
./build set php4_release 5.6
./build php n
./build rewrite_confs
The order here is important because you can't have more than one release of the same version, and you want to wait to write the confs until the users' config has been switched and the new build exists.
 
Last edited:
Back
Top