Child pages
  • WHM API 1 Functions - php_get_impacted_domains
Skip to end of metadata
Go to start of metadata

Description

This function lists domains that obtain their PHP version from a specified PHP configuration.

Important:

In cPanel & WHM version 76 and later, when you disable the WebServer role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/php_get_impacted_domains?api.version=1&system_default=1&domain=example.com
 XML API
https://hostname.example.com:2087/cpsess##########/json-api/php_get_impacted_domains?api.version=1&system_default=1&domain=example.com
 Command Line
whmapi1 php_get_impacted_domains system_default=1 domain=example.com


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
   "metadata":{
      "command":"php_get_impacted_domains",
      "version":1,
      "result":1,
      "reason":"OK"
   },
   "data":{
      "domains":[
         "example.com",
         "subdomain.example.com",
         "example2.com"
      ]
   }
}
 Output (XML)
<result>
    <metadata>
        <result>1</result>
        <command>php_get_impacted_domains</command>
        <reason>OK</reason>
        <version>1</version>
    </metadata>
    <data>
        <domains>example.com</domains>
        <domains>subdomain.example.com</domains>
        <domains>example2.com</domains>
    </data>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
system_defaultBoolean

Whether to return domains that inherit the system's default PHP version.

Notes:

  • We introduced this parameter in cPanel & WHM version 64.
  • You must pass either the system_default or domain parameters, or both.  

1 — Return domains that inherit the system's default PHP version.

0 — Do not return domains that inherit the system's default PHP version.

Note:

If you pass this parameter with a false value and do not also pass the domain parameter, the function returns an error.  

1
domainstring

A domain on the system.

Note:

  • We introduced this parameter in cPanel & WHM version 64.
  • You must pass either the system_default or domain parameters, or both.  
  • You can pass this parameter multiple times.

Any valid domain name on the system.

Note:

You cannot pass the name of a parked domain.

example.com

location

string

The location of a PHP configuration.

Note:

We removed this parameter in cPanel & WHM version 64.

    • system:default
    • domain:example.com
domain:example.com

Returns

ReturnTypeDescriptionPossible valuesExample

domains

array

The domains that obtain their PHP version from the PHP configuration.

Any valid domain or subdomain.

Note:

This function does not return parked domains.

example.com