How to check the PHP version of domains in cPanel

Please use the below command to get the information about PHP version of individual domains hosted in cPanel.

[arunlal@lintechops ]# for i in awk '{print $2}' /etc/trueuserdomains; do cd /home/$i/public_html ; echo $i - php -v| grep ^PHP | awk '{print $2}'; done

hexxxy - 7.0.33
huxxxs - 5.6.40
huxxxr - 5.6.40
huxxxxr - 7.0.33
huyyyyys - 5.6.40
orrrrghr - 5.6.40

Or we can use API of cPanel to get info about any specific version like 5.6.40.

Please use the following command.

[arunlal@lintechops ]# whmapi1 php_get_vhosts_by_version version=ea-php56
data:
vhosts:
- domain name-1
- domain name-2
metadata:
command: php_get_vhosts_by_version
reason: OK
result: 1
version: 1

Post navigation

Leave a Reply