SOLVED How to find which domains using a specific PHP version?

hinhthoi

Member
Mar 28, 2017
18
2
3
Vietnam
cPanel Access Level
Root Administrator
Hi,

Assumes my server has hundreds of domains. I want to have a quick way to show domains that are using PHP version 7 for some debugging work. (Currently most domains on the server are using php 5.6, it is very difficult to manually find domains that are using a specific PHP version).

Thank you!
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
458
113
UK
cPanel Access Level
Root Administrator
Try going to WHM >> Software >> MultiPHP Manager and searching for ea-php70 or similar

OR

In the same UI, click on the PHP Version title at the top of the table column to order your listing by versions (click again to reverse the list order)
 
  • Like
Reactions: hinhthoi

Archmactrix

Well-Known Member
Jan 20, 2012
138
2
68
cPanel Access Level
Root Administrator
You can also use a WHM API call to list the virtual hosts that use a specified version of PHP.

This the command line method I'm using here:

Code:
whmapi1 php_get_vhosts_by_version version=ea-php56
Output example:

Code:
---
data:
  vhosts:
    - example.com
    - example.com
    - example.com
    - example.com
    - example.com
    - example.com
    - example.com
metadata:
  command: php_get_vhosts_by_version
  reason: OK
  result: 1
  version: 1
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,211
363
Hello,

I'm glad to see the previous responses helped. I've marked this thread as solved.

Thanks!