List all PHP-versions for all domains

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,243
Location
GMT +7.00
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.
 

Active8

Verified User
Joined
Jul 13, 2013
Messages
282
nice plugin but function shell_exec must be enabled, on shared hosting environments that is no go in my opinion
 

wavoe

Verified User
Joined
Nov 21, 2007
Messages
67
Location
Belgium
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".
 

spacecabbie

Verified User
Joined
Oct 11, 2019
Messages
103
Location
The Netherlands
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 ?
 

Active8

Verified User
Joined
Jul 13, 2013
Messages
282
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 ?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,243
Location
GMT +7.00
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
 
Top