We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - LangPHP::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.


Note:

This document only applies to systems that run EasyApache 4.

Important:

In cPanel & WHM version 76 and later, when you disable the Web Server role, the system disables this function.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_get_impacted_domains?system_default=1&domain=example.com


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Get the affected domains.
$get_impacted_domains = $cpanel->uapi(
    'LangPHP', 'php_get_impacted_domains',
    array(
        'system_default'     => '1', 
		'domain'			 => 'example.com',
         )
);


Note:

For more information, read our Guide to the LiveAPI System.


 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Get the affected domains.
my $get_impacted_domains = $cpliveapi->uapi(
    'LangPHP', 'php_get_impacted_domains',
    (
        'system_default'     => '1',
		'domain'			 => 'example.com', 
        )
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username LangPHP php_get_impacted_domains system_default=1 domain=example.com


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
   "data":{
      "domains":[
         "example.com",
         "subdomain.example.com",
         "example2.com"
      ]
   },
   "status":1,
   "messages":null,
   "errors":null,
   "metadata":{

   }
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel 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.

Notes:

  • 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

Return
Type
Description
Possible values
Example

domains

arrayThe 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