11 functions, invoked through the cpanel_uapi tool.
scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="LangPHP", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.
This function returns a PHP version's assigned PHP handler.
Note:
This document only applies to systems that run EasyApache 4.
Important:
When you disable the WebServer role, the system disables this function. For more information, read our How to Use Server Profiles documentation.
typestringRequired
The type of php.ini file. homevhostImportant: If you set this parameter to vhost, you must also include the vhost parameter. If you set this parameter to home, the system returns the system default PHP handler.
vhoststringOptional
The name of a virtual host. Important: If the type value is vhost, you must use this parameter.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
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:
When you disable the WebServer role, the system disables this function.
domainstringOptional
A domain on the system. Note: You must pass either the system_default or domain parameters, or both. You can pass this parameter multiple times. * You cannot pass the name of a parked domain.
system_defaultintegerOptional
Whether to return domains that inherit the system's default PHP version. 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.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
domainsarray<string>
The domains that obtain their PHP version from the PHP configuration. Any valid domain or subdomain. Note: This function does not return parked domains.
This function lists the system’s default PHP version.
Important:
When you disable the Web Server role, the system disables this function.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
versionstring
The system’s default PHP version. Possible values include: An installed PHP package that cPanel provides. For example, ea-php80 An installed PHP package that another vendor provides. For example, alt-php42 * null – This value means PHP is not installed. Also, the errors return will contain a message that indicates that PHP is not installed. Note: If no default is explicitly set, the package for the newest installed version of PHP is chosen.
This function returns the PHP version of every virtual host that a reseller controls.
You can get the version of a single virtual host by providing an optional vhost name.
Note:
This document only applies to systems that run EasyApache 4.
Important:
When you disable the Web Server role, the system disables this function.
vhoststringOptional
The PHP Virtual Hostname.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
accountstring
The account's name.
account_ownerstring
The account's owner.
documentrootstring
The virtual host's document root.
homedirstring
The virtual host's home directory.
main_domaininteger
Whether the virtual host is the primary domain. Note:1 - The primary domain 0 - Not the primary domain
One of: 10
php_fpminteger
Whether FPM is enabled on the virtual host. 1 - PHP-FPM enabled. 0 - PHP-FPM not enabled.
One of: 01
php_fpm_pool_parmsobject
An object containing the domain's PHP-FPM parameters.
pm_max_childreninteger
The maximum number of child pages per pool.
pm_max_requestsinteger
The maximum number of requests per pool.
pm_process_idle_timeoutinteger
A specified time of idleness before the system kills an FPM child process.
phpversion_sourcearray<object>
How the virtual host determines its PHP version.
domainstring
The domain the virtual host inherits its PHP version from.
system_defaultinteger
Whether the virtual host uses the system's default PHP version. * 1 - Uses the system default PHP version. Note: The function only returns this value if true.
One of: 1
versionstring
The virtual host's PHP version. ea-php72ea-php73ea-php74 Any custom PHP package name.
This function lists a virtual host's basic PHP directives. The Basic Mode section of cPanel's MultiPHP INI Editor interface (Home >> Software >> MultiPHP INI Editor) also lists these directives.
Note:
This document only applies to systems that run EasyApache 4 with MultiPHP enabled.
Important:
When you disable the WebServer role, the system disables this function.
typestringRequired
The type of php.ini file. - home - vhostImportant: If you set this parameter to vhost, you must also include the vhost parameter.
vhoststringOptional
The name of a virtual host. Important: If the type value is vhost, you must use this parameter.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
directivesarray<object>
An array of the available directives in the php.ini file of the selected user's PHP version.
default_valueany
The directive's default value.
infostring
The purpose of the directive.
keystring
The directive's name.
php_ini_modestring
The directive's PHP_INI mode. PHP_INI_SYSTEMPHP_INI_PERDIRPHP_INI_ALLPHPINI_ONLY
One of: PHP_INI_SYSTEMPHP_INI_PERDIRPHP_INI_ALLPHPINI_ONLY
typestring
The type of value that the directive uses. stringbooleanintegerfloat
This function lists the php.ini file paths for the user's home directory and virtual host document roots.
Note:
This document only applies to systems that run EasyApache 4 with MultiPHP enabled.
Important:
When you disable the WebServer role, the system disables this function.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
pathsarray<object>
An array of objects of php.ini file information.
accountstring
The account's name.
documentrootstring
The virtual host's document root.
homedirstring
The home directory.
main_domaininteger
Whether the virtual host is the account's primary domain. 1 - Primary domain. 0 - Not the primary domain.
One of: 10
pathstring
The name of the virtual host's php.ini file.
typestring
The record's type. homevhost
One of: homevhost
versionstring
The default PHP version. - ea-php##, where ## represents the major and minor versions of PHP (for example, ea-php72 represents PHP 7.2). - Any custom PHP package name.
This function sets the values of any basic PHP directive. The Basic Mode section of cPanel's MultiPHP INI Editor interface (WHM >> Home >> Software >> MultiPHP INI Editor) lists these directives.
Note:
This document only applies to systems that run EasyApache 4 with MultiPHP enabled.
Important:
When you disable the Web Server role, the system disables this function.
directivestringRequired
The name of a PHP directive and its value. Note: To change the directive's value for multiple PHP directives, increment the parameter name. For example, the directive-1, directive-2, and directive-3 parameters. You must format values as <directive>:<value>
typestringRequired
The type of php.ini file. homevhostImportant: If you set this parameter to vhost, you must also include the vhost parameter.
vhoststringOptional
The name of a virtual host. Important: If the type value is vhost, you must use this parameter.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This document only applies to systems that run EasyApache 4.
Important:
When you disable the WebServer role, the system disables this function.
versionstringRequired
The PHP version of a virtual host.
vhoststringRequired
The virtual host's name. Note: To change the PHP version of multiple virtual hosts, duplicate or increment the parameter name. For example, vhost-1, vhost-2, and vhost-3.
Response — normalized as { ok, data, errors[], warnings[] }; data contains: