Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General Discussion' started by hinhthoi, Sep 9, 2017.

  1. hinhthoi

    hinhthoi Member

    Joined:
    Mar 28, 2017
    Messages:
    13
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    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!
     
  2. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    301
    Likes Received:
    88
    Trophy Points:
    28
    Location:
    Spain
    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)
     
    hinhthoi likes this.
  3. Archmactrix

    Archmactrix Well-Known Member

    Joined:
    Jan 20, 2012
    Messages:
    134
    Likes Received:
    2
    Trophy Points:
    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 and hinhthoi like this.
  4. hinhthoi

    hinhthoi Member

    Joined:
    Mar 28, 2017
    Messages:
    13
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Vietnam
    cPanel Access Level:
    Root Administrator
    Thank you, this is informative!
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

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

    Thanks!
     
Loading...

Share This Page