List all PHP-versions for all domains

Hello,

At the moment it can be done only in a console of the web-server. See

Code:
egrep php[1,2,3,4]_select= /usr/local/directadmin/data/users/*/domains/*.conf

where php1_select corresponds to the primary PHP version installed on the server, and php2_select/php3_select/php4_select correspond to the secondary PHP versions per custombuild options:

Code:
[root@server ~]# /usr/local/directadmin/custombuild/build options | grep PHP
PHP (default): 5.6 as suphp
PHP (additional): 5.3 as suphp
PHP (additional, 3rd): 7.2 as suphp
PHP (additional, 4th): 7.3 as suphp
[root@server ~]#

So, let's say you have PHP 7.2 installed under PHP 3rd, so run

Code:
egrep php3_select=1 /usr/local/directadmin/data/users/*/domains/*.conf

to list config files for domains with PHP 7.2.
 
nice plugin but function shell_exec must be enabled, on shared hosting environments that is no go in my opinion
 
nice plugin but function shell_exec must be enabled, on shared hosting environments that is no go in my opinion
I understand this concern. The shell_exec is used to read out the users configuration file to see which php version is configured per domain.
I agree that you should disable this for your users but this is running under the user "diradmin".
 
I understand this concern. The shell_exec is used to read out the users configuration file to see which php version is configured per domain.
I agree that you should disable this for your users but this is running under the user "diradmin".
May I suggest and extensive edit of the readme. since it looks like you have covert most concerns people are just not aware ?
 
Can you provide the steps to give the right to a particular user only to use shell_exec. ?
Must we make a custom php.ini or so ?
 
If your plugin requires a disabled PHP function, then you'd better ship your plugin with its own php.ini and use it in scripts, instead of instructing admins to enable the function.

For this you change phpversionlist/admin/index.html:

find the top line:

Code:
#!/usr/local/bin/php

and change it to:

Code:
#!/usr/local/bin/php -nc/usr/local/directadmin/plugins/phpversionlist/php.ini

then install /usr/local/directadmin/plugins/phpversionlist/php.ini with a modified list of disabled functions.

See how we do it in https://github.com/poralix/load_monitor
 
It would be a great feature to have a way to see the number of websites using a specific PHP version and then when clicking on the number per PHP, see a list or popup of the list of domains for that PHP version.
 
It would be a great feature to have a way to see the number of websites using a specific PHP version and then when clicking on the number per PHP, see a list or popup of the list of domains for that PHP version.

It sure would. Why not use some of the (wide open) space in Admin > Dashboard / PHP Settings ???
 
Just for future reference you can also view all users PHP versions at server manager >>> custom HTTPD configurations.
Thanks for that! I knew I had seen this somewhere, however, as a new DA user, I having difficulty finding things a second time.

I sure would like to be able to change the PHP version from that page.
 
If it was there I wouldn't have posted ofcourse.
"custom HTTPD configurations" also isn't located under "server manager" (which should read "Server Management"), but under "Extra Features".
That's why I asked if this is only visible with the Evolution-theme, and not under the Enhanced-theme perhaps.

The plugin above worked very nice and I would have liked to see this as something 'default' into DA.
 

Attachments

  • screenpic 22.jpg
    screenpic 22.jpg
    142.3 KB · Views: 68
Back
Top