0

I've got a server running a primary and secondary PHP version (in this case 5 and 7). I'm slowly migrating all sites hosted there to PHP 7. I set the PHP version through the DirectAdmin domain setup options.

My question is, is there a way to list what user is using what PHP version? Either through DirectAdmin, or SSH.

I've tried calling php --version, but that just returns the primary PHP version.

I'm looking for a way to get a nice list of active PHP versions.

Info:

  • CentOS 7
  • DirectAdmin 1.50 (with custombuild 2.0)
Sander Koedood
  • 6,007
  • 6
  • 25
  • 34
  • It is `$ phpenv versions`, if you were using [phpenv](https://github.com/phpenv/phpenv) to manage php versions, but I guess you are using something different? – Alex Blex Oct 18 '16 at 10:14
  • Yes, it's a built-in DirectAdmin feature, I believe. phpenv isn't installed. – Sander Koedood Oct 18 '16 at 10:39

2 Answers2

1

When you run

grep php /usr/local/directadmin/data/users/*/domains/*.conf

The output will show you the PHP settings for all domains.

Eg.

/usr/local/directadmin/data/users/client1/domains/domain1.org.conf:php=ON
/usr/local/directadmin/data/users/client1/domains/domain1.org.conf:php1_select=2
/usr/local/directadmin/data/users/client1/domains/domain1.org.conf:php2_select=1
/usr/local/directadmin/data/users/client2/domains/domain2.com.conf:php=ON
/usr/local/directadmin/data/users/client2/domains/domain3.net.conf:php=ON
/usr/local/directadmin/data/users/client2/domains/domain3.net.conf:php1_select=1
/usr/local/directadmin/data/users/client2/domains/domain3.net.conf:php2_select=2
Joost
  • 464
  • 4
  • 5
0

Have you try this:

sudo update-alternatives --list php

And for change the php default :

update-alternatives --config php

you should see something like this:

  Sélection   Chemin           Priorité  État
------------------------------------------------------------
* 0            /usr/bin/php7.0   70        mode automatique
  1            /usr/bin/php5     50        mode manuel
  2            /usr/bin/php5.6   56        mode manuel
  3            /usr/bin/php7.0   70        mode manuel
th3fr33man
  • 60
  • 1
  • 5