openapi: 3.2.0 info: title: Cpanel PHP API version: 11.137.9999.106 contact: email: cs@cpanel.net name: WebPros International, LLC url: https://cpanel.net/support/ license: name: cPanel License url: https://cpanel.net/legal-notices/ termsOfService: https://cpanel.net/legal-notices/ x-api-evangelist-provenance: 'Harvested verbatim from cPanel''s developer portal on 2026-09-05 via the MCP tool get-full-api-description at https://api.docs.cpanel.net/mcp. ONE mechanical change was made before storage: example values containing PEM private-key or certificate blocks, and AWS-access-key-shaped example strings, were replaced with REDACTED_* placeholders so the file can be stored in a public git repository without tripping secret scanning. No path, operation, parameter, schema or description was altered, added or removed.' description: 'Operations tagged PHP across 2 of this provider''s published API definitions: cpanel-uapi-openapi.yml, cpanel-whm-api-openapi.yml. Each path carries the servers of the definition it was published in.' servers: - description: A server running cPanel. url: https://{host}:{port}/execute variables: host: default: cpanel-server.tld description: The hostname of a server running cPanel. port: default: '2083' description: The cPanel port. - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. security: - BasicAuth: [] tags: - description: PHP recommendations name: PHP paths: /EA4/get_php_recommendations: get: x-readonly: true description: This function returns a list of recommended PHP versions. operationId: EA4-get_php_recommendations parameters: [] responses: '200': content: application/json: schema: properties: apiversion: description: The version of the API. example: 3 type: integer func: description: The name of the method called. example: get_php_recommendations type: string module: description: The name of the module called. example: EA4 type: string result: properties: data: description: An array of recommended PHP versions. items: example: php80 type: string type: array errors: description: List of errors if the API failed. example: null items: type: string type: - array - 'null' messages: description: List of messages generated by the API. example: null items: type: string type: - array - 'null' metadata: properties: transformed: description: Post-processing may have transformed the data. enum: - 1 example: 1 type: integer status: description: '* `1` - Success. * `0` - Failed. Check the `errors` field for more details.' enum: - 1 - 0 example: 1 type: integer warnings: description: List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API. example: null items: type: string type: - array - 'null' type: object type: object description: HTTP Request was successful. summary: Get custom PHP recommendations tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "uapi --output=jsonpretty \\\n --user=username \\\n EA4 \\\n get_php_recommendations\n" - label: URL lang: HTTP source: https://hostname.example.com:2083/cpsess##########/execute/EA4/get_php_recommendations - label: LiveAPI Perl lang: Perl source: "#--------------------------------------------------------------------------------------\n# Instructions:\n#--------------------------------------------------------------------------------------\n# is the theme assigned to cPanel account.\n# 1) cd /usr/local/cpanel/base/frontend/\n# 2) mkdir api_examples\n# 3) cd api_examples\n# 4) create a file EA4_get_php_recommendations.live.pl and put this code into that file.\n# 5) In your browser login to a cPanel account.\n# 6) Manually change the url from: .../frontend//\n# to .../frontend//api_examples/EA4_get_php_recommendations.live.pl\n#--------------------------------------------------------------------------------------\n\nuse strict;\n\nuse Cpanel::LiveAPI ();\n\nmy $cpanel = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.\n\n# Print the header\nprint \"Content-type: text/plain\\r\\n\\r\\n\";\n\n# Call the API\nmy $response = $cpanel->uapi(\n q/EA4/,\n q/get_php_recommendations/\n);\n\n# Handle the response\nif ($response->{cpanelresult}{result}{status}) {\n my $data = $response->{cpanelresult}{result}{data};\n foreach my $item (@{$data}) {\n # Do something with the $item\n }\n\n # So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n # Report errors:\n print to_json($response->{cpanelresult}{result}{errors});\n}\n\n# Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n#--------------------------------------------------------------------------------------\n# Helper function to convert a perl object to html printable json\n#--------------------------------------------------------------------------------------\nsub to_json {\n require JSON;\n my $str = JSON->new->pretty->encode($_[0]);\n return $str;\n}\n" - label: LiveAPI PHP lang: PHP source: " is the theme assigned to cPanel account.\n// 1) cd /usr/local/cpanel/base/frontend/\n// 2) mkdir api_examples\n// 3) cd api_examples\n// 4) create a file EA4_get_php_recommendations.live.php and put this code into that file.\n// 5) In your browser login to a cPanel account.\n// 6) Manually change the url from: .../frontend//\n// to .../frontend//api_examples/EA4_get_php_recommendations.live.php\n//--------------------------------------------------------------------------------------\n\n// Instantiate the CPANEL object.\nrequire_once \"/usr/local/cpanel/php/cpanel.php\";\n\n// Print the header\nheader('Content-Type: text/plain');\n\n// Connect to cPanel - only do this once.\n$cpanel = new CPANEL();\n\n// Call the API\n$response = $cpanel->uapi(\n 'EA4',\n 'get_php_recommendations'\n);\n\n// Handle the response\nif ($response['cpanelresult']['result']['status']) {\n $data = $response['cpanelresult']['result']['data'];\n foreach ($data as $item) {\n // Do something with the $item\n }\n\n // So you can see the data shape we print it here.\n print to_json($data);\n}\nelse {\n // Report errors:\n print to_json($response['cpanelresult']['result']['errors']);\n}\n\n// Disconnect from cPanel - only do this once.\n$cpanel->end();\n\n//--------------------------------------------------------------------------------------\n// Helper function to convert a PHP value to html printable json\n//--------------------------------------------------------------------------------------\nfunction to_json($data) {\n return json_encode($data, JSON_PRETTY_PRINT);\n}" x-cpanel-api-version: UAPI x-cpanel-available-version: 82 servers: - description: A server running cPanel. url: https://{host}:{port}/execute variables: host: default: cpanel-server.tld description: The hostname of a server running cPanel. port: default: '2083' description: The cPanel port. /php_get_handlers: get: description: 'This function returns the PHP handlers on the system. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_get_handlers parameters: - description: 'An installed PHP version. * `ea-php54` * `ea-php55` * `ea-php56` * `ea-php70` * `ea-php71` * `ea-php72` * `inherit` * Any custom PHP package name. **Important:** We deprecated PHP 5.6 and PHP 7.0 and will remove them in a future version. For more information, read our [cPanel Deprecation Plan](https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-deprecation-plan/) documentation.' in: query name: version required: false schema: example: ea-php72 type: string responses: '200': content: application/json: schema: properties: data: properties: version_handlers: description: An array of objects containing the available PHP handlers. items: properties: available_handlers: description: 'The installed PHP handlers. * `suphp` * `cgi` * `dso` * `none`' example: - cgi - none - suphp items: enum: - suphp - cgi - dso - none type: string type: array current_handler: description: 'The PHP version''s handler. * `suphp` * `cgi` * `dso` * `none`' enum: - suphp - cgi - dso - none example: suphp type: string version: description: 'An installed PHP version. * `ea-php54` * `ea-php55` * `ea-php56` * `ea-php70` * `ea-php71` * `ea-php72` * `inherit` * Any custom PHP package name. **Important:** We deprecated PHP 5.6 and PHP 7.0 and will remove them in a future version. For more information, read our [cPanel Deprecation Plan](https://docs.cpanel.net/knowledge-base/cpanel-product/cpanel-deprecation-plan/) documentation.' example: ea-php72 type: string type: object type: array type: object metadata: properties: command: description: The method name called. example: php_get_handlers type: string reason: description: The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds. example: OK type: string result: description: '* `1` — Success. * `0` — Failed. Check the `reason` field for more details.' enum: - 1 - 0 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Return PHP handlers tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_get_handlers\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_get_handlers?api.version=1 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '54' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_get_impacted_domains: get: description: 'This function lists domains that obtain their PHP version from a specified PHP configuration. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_get_impacted_domains parameters: - description: '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.' examples: multiple: summary: Pass multiple domains. value: domain=example.com domain=example2.com domain=example3.com single: summary: Pass a single domain. value: example.com in: query name: domain required: true schema: type: string - description: '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:** * You **must** pass either the `system_default` or `domain` parameters, or both. * If you pass this parameter with a false value and do **not** also pass the `domain` parameter, the function returns an error.' in: query name: system_default required: true schema: enum: - 1 - 0 example: 1 type: integer responses: '200': content: application/json: schema: properties: data: properties: domains: description: 'A list of domains or subdomains that obtain their PHP version from the PHP configuration. **Note:** This function does **not** return parked domains.' example: - example.com - subdomain.example.com - example2.com items: type: string type: array type: object metadata: properties: command: description: The method name called. example: php_get_impacted_domains type: string reason: description: The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds. example: OK type: string result: description: '* `1` — Success. * `0` — Failed. Check the `reason` field for more details.' enum: - 1 - 0 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Return PHP preconfigured domains tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_get_impacted_domains \\\n system_default='1' \\\n domain='example.com'\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_get_impacted_domains?api.version=1&system_default=1&domain=example.com x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '62' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_get_installed_versions: get: description: 'This function returns the installed PHP versions on a server. **Note:** This document **only** applies to systems that run EasyApache 4. **Important:** When you disable the Web Server role , the system **disables** this function.' operationId: PHP-php_get_installed_versions parameters: [] responses: '200': content: application/json: schema: properties: data: properties: versions: description: 'The installed PHP versions. - ea-php71 - ea-php72 - ea-php73 - ea-php74 - Any custom PHP package name.' items: example: ea-php74 type: string type: array type: object metadata: properties: command: description: The method name called. example: php_get_installed_versions type: string reason: description: The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds. example: Ok type: string result: description: '* `1` - Success. * `0` - Failed: Check the reason field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Return installed PHP versions tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_get_installed_versions\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_get_installed_versions?api.version=1 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '11.52' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_get_system_default_version: get: description: 'This function returns the system default PHP version. **Note:** This document **only** applies to systems that run EasyApache 4. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_get_system_default_version parameters: [] responses: '200': content: application/json: schema: properties: data: properties: version: description: 'The server''s default PHP version. * `ea-php##`, where `##` represents the major and minor versions of PHP (for example, `ea-php72` represents PHP 7.2). * `inherit` * Any custom PHP package name.' example: ea-php56 type: string type: object metadata: properties: command: description: The method name called. example: php_get_system_default_version type: string reason: description: The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds. example: Ok type: string result: description: '* `1` — Success. * `0` — Failed. Check the `reason` field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Return system default PHP version tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_get_system_default_version\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_get_system_default_version?api.version=1 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '11.52' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_get_vhost_versions: get: description: 'This function returns the PHP version of every virtual host that a reseller controls. **Note:** This document **only** applies to systems that run EasyApache 4. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_get_vhost_versions parameters: [] responses: '200': content: application/json: schema: properties: data: properties: versions: description: An array of objects containing the virtual host's suspendend status, versions, virtual hosts, and accounts. items: properties: account: description: The account's name. example: rm3 format: username type: string account_owner: description: The account owner's name. example: root format: username type: string documentroot: description: The virtual host's document root. example: /home/example/public_html type: string homedir: description: The virtual host's home directory. example: /home/rm3 type: string is_suspended: description: 'The virtual host''s suspension status. **Note:** * `1` - Suspended * `0` - **Not** suspended.' enum: - 1 - 0 example: 0 type: integer main_domain: description: 'Whether the virtual host is the primary domain. **Note:** * `1` - The primary domain * `0` - **Not** the primary domain' enum: - 1 - 0 example: 1 type: integer php_fpm: description: 'Whether PHP-FPM is enabled. * `1` - PHP-FPM enabled. * `0` - PHP-FPM **not** enabled.' enum: - 1 - 0 example: 1 type: integer php_fpm_pool_parms: description: Object containing the domain's PHP-FPM parameters. properties: pm_max_children: description: The maximum number of child pages per pool. example: 5 minimum: 1 type: integer pm_max_requests: description: The number of possible requests the system allows. example: 20 minimum: 1 type: integer pm_process_idle_timeout: description: How long the system remains idle before it kills the FPM child process. example: 10 minimum: 1 type: integer type: object phpversion_source: description: How the virtual host determines its PHP version. items: properties: domain: description: The domain the virtual host inherits its PHP version from. example: example.com format: domain type: string system_default: description: "Whether the virtual host uses the system's default PHP version.\n* `1` - Uses the system default PHP version.\n\n**Note:**\n\n The function **only** returns this value if true." enum: - 1 example: 1 type: integer type: object properties: system_default: {} type: array version: description: 'The virtual host''s PHP version. * `ea-php72` * `ea-php73` * `ea-php74` * `inherit` * Any custom PHP package name.' example: ea-php72 type: string vhost: description: The virtual host's name. example: otherchars.rm3.tld type: string type: object type: array type: object metadata: properties: command: description: The method name called. example: php_get_vhost_versions type: string reason: description: The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds. example: OK type: string result: description: '* `1` - Success * `0` - Failed: Check the reason field for more details.' enum: - 1 - 0 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Return PHP version of all virtual hosts tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_get_vhost_versions\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_get_vhost_versions?api.version=1 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '60' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_get_vhosts_by_version: get: description: 'This function lists the virtual hosts that use a specified version of PHP. **Note:** This document only applies to systems that run EasyApache 4. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_get_vhosts_by_version parameters: - description: 'The name of an installed PHP package. - `ea-php##`, where `##` represents the major and minor versions of PHP (for example, `ea-php72` represents PHP 7.2). - `inherit` - Any custom PHP package name.' in: query name: version required: true schema: example: ea-php56 type: string responses: '200': content: application/json: schema: properties: data: properties: vhosts: description: An array of the virtual hosts that use the specified PHP version. items: example: example.com format: domain type: string type: array type: object metadata: properties: command: description: The method name called. example: php_get_vhosts_by_version type: string reason: description: The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds. example: OK type: string result: description: '* `1` — Success. * `0` — Failed. Check the `reason` field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Return virtual hosts per PHP version tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_get_vhosts_by_version \\\n version='ea-php56'\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_get_vhosts_by_version?api.version=1&version=ea-php56 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '62' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_ini_get_content: get: description: 'This function returns the contents of a PHP version''s `php.ini` file. **Note:** This document **only** applies to systems that run EasyApache 4. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_ini_get_content parameters: - description: "The name of an installed PHP version's package.\n - `ea-php##`, where `##` represents the major and minor versions of PHP (for example, `ea-php74` represents PHP 7.4).\n - `inherit`\n - Any custom PHP package name. " in: query name: version required: true schema: example: ea-php74 type: string responses: '200': content: application/json: schema: properties: data: properties: content: description: The contents of the requested PHP version's `php.ini` file. example: 'display_errors; Default Value: On; Development Value: On; Production Value: Off;' type: string metadata: properties: command: description: The method name called. example: php_ini_get_content type: string reason: description: The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds. example: Ok type: string result: description: '* `1` - Success * `0` - Failed: Check the reason field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Return PHP version's php.ini file tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_ini_get_content \\\n version='ea-php74'\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_ini_get_content?api.version=1&version=ea-php74 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '11.52' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_ini_get_directives: get: description: 'This function returns the directives in the selected PHP version''s php.ini file. WHM''s *MultiPHP INI Editor* interface (*Home >> Software >> MultiPHP INI Editor*) lists these directives in the *Basic Mode* section. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_ini_get_directives parameters: - description: 'The name of an installed version of PHP. * `ea-php72` * `ea-php73` * `ea-php74` * Any custom PHP package name' in: query name: version required: true schema: example: ea-php74 type: string responses: '200': content: application/json: schema: properties: data: properties: directives: description: An array of directives that are available in the `php.ini` file of the selected version of PHP. items: properties: default_value: description: The directive's default value. example: '1' type: string info: description: The purpose of the directive. example: This option enables the URL-aware fopen wrappers that enable accessing URL object like files. Default wrappers are provided for the access of remote files using the ftp or http protocol, some extensions like zlib may register additional wrappers. type: string key: description: The directive's name. example: allow_url_fopen type: string php_ini_mode: description: 'The directive''s [PHP_INI mode](http://php.net/manual/en/configuration.changes.modes.php). * `PHP_INI_SYSTEM` * `PHP_INI_PERDIR` * `PHP_INI_ALL` * `PHPINI_ONLY`' example: PHP_INI_SYSTEM type: string type: description: 'The type of value that the directive uses. * `string` * `boolean` * `integer` * `float`' enum: - string - boolean - integer - float example: boolean type: string value: description: The directive's current value. example: 'On' type: string type: object type: array type: object metadata: properties: command: description: The method name called. example: php_ini_get_directives type: string reason: description: The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds. example: Ok type: string result: description: '* `1` - Success * `0` - Failed: Check the reason field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Return PHP version's directives tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_ini_get_directives \\\n version='ea-php74'\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_ini_get_directives?api.version=1&version=ea-php74 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '11.52' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_ini_set_content: post: description: 'This function changes the contents of a PHP version''s php.ini file. **Notes:** - This document **only** applies to systems that run EasyApache 4. - Due to the limited field length of HTTP GET method calls, we **strongly** recommend that you use the HTTP POST method. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_ini_set_content parameters: - description: The contents of the `php.ini` file that you wish to change. in: query name: content required: true schema: example: '[PHP] ; About php.ini ; php.ini is responsible for configuring many of the aspects of PHP''s behavior. pcre.backtrack_limit=100000 ' type: string - description: 'The version of PHP for which you wish to change the `php.ini` file. * `ea-php72` * `ea-php73` * `ea-php74` * `Any custom PHP package name`' in: query name: version required: true schema: example: ea-php74 type: string responses: '200': content: application/json: schema: properties: data: type: object metadata: properties: command: description: The method name called. example: php_ini_set_content type: string reason: description: The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds. example: Ok type: string result: description: '* `1` - Success * `0` - Failed: Check the reason field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Update PHP version's php.ini file tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_ini_set_content \\\n content=$'[PHP]\n; About php.ini\n; php.ini is responsible for configuring many of the aspects of PHP\\'s behavior.\npcre.backtrack_limit=100000\n' \\\n version='ea-php74'\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_ini_set_content?api.version=1&content=%5bPHP%5d%0a%3b%20About%20php.ini%0a%3b%20php.ini%20is%20responsible%20for%20configuring%20many%20of%20the%20aspects%20of%20PHP%27s%20behavior.%0apcre.backtrack_limit%3d100000%0a&version=ea-php74 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '11.52' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_ini_set_directives: get: description: 'This function sets the value of a PHP version''s directives. **Note:** This document only applies to systems that run EasyApache 4. **Important:** When you disable the Web Server role , the system **disables** this function.' operationId: PHP-php_ini_set_directives parameters: - description: "The name of a PHP directive and its value.\n\n**Note:**\n\n To change the directive's value for multiple PHP directives, duplicate or increment the parameter name. For example, to change three directives, use the directive parameter multiple times or use the `directive-1`, `directive-2` , and `directive-3` parameters." examples: multiple: summary: Set the values for multiple directives. value: directive-1=allow_url_fopen:0&directive-2=max_input_vars=1000 single: summary: Set the value for a single directive. value: allow_url_fopen:0 in: query name: directive required: true schema: type: string - description: 'PHP version on the system. **Note** * `ea-php56` * `ea-php70` * `ea-php71` * `ea-php72` * Any custom PHP package name.' in: query name: version required: true schema: example: ea-php72 type: string responses: '200': content: application/json: schema: properties: data: example: {} type: object metadata: properties: command: description: The method name called. example: php_ini_set_directives type: string reason: description: The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds. example: Ok type: string result: description: '* `1` - Success * `0` - Failed: Check the reason field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Update PHP version's directives tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_ini_set_directives \\\n directive='allow_url_fopen:0' \\\n version='ea-php72'\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_ini_set_directives?api.version=1&directive=allow_url_fopen%3a0&version=ea-php72 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '11.52' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_set_handler: get: description: 'This function sets a PHP version''s handler. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_set_handler parameters: - description: 'An installed PHP handler. * `cgi` * `suphp` * `dso` * `none`' in: query name: handler required: true schema: enum: - cgi - suphp - dso - none example: suphp type: string - description: 'An installed PHP version. * `ea-php54` * `ea-php55` * `ea-php56` * `ea-php70` * `ea-php71` * `ea-php72` * `inherit` * Any custom PHP package name.' in: query name: version required: true schema: example: ea-php70 type: string responses: '200': content: application/json: schema: properties: metadata: properties: command: description: The method name called. example: php_set_handler type: string reason: description: The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds. example: OK type: string result: description: '* `1` — Success. * `0` — Failed. Check the `reason` field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Update PHP version's handler tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_set_handler \\\n version='ea-php70' \\\n handler='suphp'\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_set_handler?api.version=1&version=ea-php70&handler=suphp x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '54' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_set_session_save_path: get: description: 'This function sets the location of PHP''s default session save path. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_set_session_save_path parameters: - description: 'Whether to overwrite the existing session save path in the `php.ini` file. * `1` — Overwrite the existing value in the `php.ini` file. * `0` — Do **not** overwrite the existing value in the `php.ini` file.' in: query name: overwrite required: false schema: default: 0 enum: - 0 - 1 example: 0 type: integer - description: 'The directory in which to save session information. **Warning:** For security reasons, do **not** set this value to `/tmp` or another insecure location.' in: query name: path required: false schema: default: /var/cpanel/php/sessions example: /var/cpanel/php/sessions type: string responses: '200': content: application/json: schema: properties: metadata: properties: command: description: The method name called. example: php_set_session_save_path type: string reason: description: The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds. example: OK type: string result: description: '* `1` — Success. * `0` — Failed. Check the `reason` field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Update PHP default save path tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_set_session_save_path\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_set_session_save_path?api.version=1 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '66' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_set_system_default_version: get: description: 'The version of PHP that you wish to set as the system''s default. * `ea-php81` * `inherit` * Any custom PHP package name. **Important:** When you disable the Web Server role, the system **disables** this function.' operationId: PHP-php_set_system_default_version parameters: - description: The version of PHP that you wish to set as the system's default. in: query name: version required: true schema: example: ea-php81 type: string responses: '200': content: application/json: schema: properties: metadata: properties: command: description: The method name called. example: php_set_system_default_version type: string reason: description: The reason the API function failed when the `metadata.result` field is 0. This field may display a success message when a function succeeds. example: Ok type: string result: description: '* `1` - Success * `0` - Failed: Check the reason field for more details.' enum: - 0 - 1 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Update default PHP version tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_set_system_default_version \\\n version='ea-php74'\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_set_system_default_version?api.version=1&version=ea-php74 x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '11.52' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. /php_set_vhost_versions: get: description: 'This function allows WHM''s *MultiPHP Manager* interface (*WHM >> Home >> Software >> MultiPHP Manager*) to change the values of a domain. **Important:** When you disable the Web Server role, the system **disables** this function. **Warning:** We **strongly** recommend that you only activate Apache PHP-FPM if your server has at least 2 GB of RAM available, or at least 30 MB of RAM per domain. If you enable PHP-FPM on a server with **less** than the required RAM, your server may experience severe performance issues.' operationId: PHP-php_set_vhost_versions parameters: - description: 'The virtual host''s (vhost) PHP version. **Note:** This parameter also accepts any custom PHP package names.' in: query name: version required: true schema: enum: - ea-php54 - ea-php55 - ea-php56 - ea-php70 - ea-php71 - ea-php72 - inherit example: ea-php70 type: string - description: 'The virtual host''s name. **Note:** To set multiple vhosts, increment the parameter name. For example, `vhost-1`, `vhost-2`, and `vhost-3`.' examples: multiple: summary: Set multiple vhosts. value: vhost-1=otherchars.rm3.tld vhost-2=morechars.rm3.tld vhost-3=lotschars.rm3.tld single: summary: Set a single vhost. value: otherchars.rm3.tld in: query name: vhost required: true schema: type: string - description: 'Whether PHP-FPM is enabled. * `1` — Enabled. * `0` — Disabled.' in: query name: php_fpm required: false schema: default: 0 enum: - 1 - 0 example: 1 type: integer - content: application/json: schema: example: pm_max_children: 5 pm_max_requests: 20 pm_process_idle_timeout: 10 format: json properties: pm_max_children: default: 5 description: The maximum number of child pages per pool. example: 5 type: integer pm_max_requests: default: 20 description: The maximum number of requests per pool. example: 20 type: integer pm_process_idle_timeout: default: 10 description: A specified time of idleness before the system kills an FPM child page. example: 10 type: integer required: - pm_max_children - pm_process_idle_timeout - pm_max_requests type: object description: A JSON-encoded string containing a hash of values. in: query name: php_fpm_pool_parms required: false responses: '200': content: application/json: schema: properties: metadata: properties: command: description: The method name called. example: php_set_vhost_versions type: string reason: description: The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds. example: OK type: string result: description: '* `1` — Success. * `0` — Failed. Check the `reason` field for more details.' enum: - 1 - 0 example: 1 type: integer version: description: The version of the API function. example: 1 type: integer type: object description: HTTP Request was successful. summary: Update domain's PHP values tags: - PHP x-codeSamples: - label: CLI lang: Shell source: "whmapi1 --output=jsonpretty \\\n php_set_vhost_versions \\\n version='ea-php70' \\\n vhost='otherchars.rm3.tld'\n" - label: URL lang: HTTP source: https://hostname.example.com:2087/cpsess##########/json-api/php_set_vhost_versions?api.version=1&version=ea-php70&vhost=otherchars.rm3.tld x-cpanel-api-version: WHM API 1 x-cpanel-available-version: '60' servers: - description: A server running WHM. url: https://{host}:{port}/json-api variables: host: default: whm-server.tld description: The hostname of a server running WHM. port: default: '2087' description: The WHM port. components: securitySchemes: BasicAuth: scheme: basic type: http externalDocs: url: https://cpanel.net/developers/ x-refined-from: - cpanel-uapi-openapi.yml - cpanel-whm-api-openapi.yml x-tagGroups: - name: API Development Tools tags: - API Token Management - Batch - SSE Task Management - URL Parsing - name: Authentication tags: - External Authentication - Two-Factor Settings - name: Backup Information tags: - BackupInfo - BackupInfo Status - name: Block Ip Addresses tags: - Block IP - name: Commerce Integration tags: - Market Integration - SSL Certificates - name: Contact Information tags: - Contact Information - name: cPanel Account tags: - Account Enhancements - Account Information - Account Management - AuditLog - Contact Information - cPanel Features - Disk Quotas - DomainRecommendations - Personalization - Resource Usage and Statistics - Subaccount Management - Team Roles - Team Users - name: cPanel Account Backups tags: - Backup - File Restoration - name: cPanel Plugin Framework tags: - Formbricks - Plugins - name: cPanel Theme Management tags: - Application Information - Brand Management - Branding Files - Browser Cache Management - Language - Theme Settings - name: Directory Management tags: - Directory Indexes - Directory Privacy - Directory Protection - name: DNS tags: - DNS - DNS Information - DNS Security - Dynamic DNS - Email DNS Settings - ZoneEdit - name: Domain tags: - Domain - name: Domain Management tags: - AddonDomain - Direct Link Protection (Hotlink) - Domain - Domain Information - Domain Redirection - DomainLookup - Park - SubDomain - Virtual Host Information - name: Domains tags: - Subdomains - name: Email tags: - Email Accounts - Email Filtering - Email Forwarding - Email Server Information - Email Suspensions - Mail Server Information - Mailbox Management - Mailing Lists - Signing and Encryption (GnuPG Keys) - Spam Filtering (Greylisting) - Spam Management - Spam Prevention (BoxTrapper) - Webmail Applications - Webmail Sessions - name: Extract Information tags: - ExtractInfo - ExtractInfo Status - name: File Manager tags: - Trash - name: Files tags: - FTP Accounts - FTP Server Settings - Image Tools - Jodit - Manage Files - Manage Files - WebDisk Settings - name: GIT Management tags: - Deployment Settings - Repository Management - name: InProductSurvey tags: - InProductSurvey - name: MySQL and MariaDB tags: - Database Information - Database Management - Remote Databases - User Management - name: Notifications tags: - Pushbullet - name: Optional Applications tags: - Antivirus Protection (ClamAV) - Calendar and Contacts (DAV) - Calendar and Contacts Server - WordPress Manager Backups - name: PostgreSQL tags: - PostgreSQL Database Management - PostgreSQL User Management - name: Retrieve bandwidth information tags: - Bandwidth - name: Security tags: - Known SSH Hosts Management - Login Information - name: Server Information tags: - cPanel Server Information - Notifications - Password Strength - SSH - WebPros MCP - WebProsMCP - name: ServiceProxy tags: - ServiceProxy - name: Site Quality Monitoring tags: - SiteQuality - name: SSL Certificates tags: - Auto-generated SSL Certificates - cPanel Account SSL Management - SNI Email Settings - SSL Certificate Management - Verify Domain Ownership - name: Statistics tags: - Domain Statistics - Weblog Settings - name: UserData tags: - UserData - name: Web Server Configuration tags: - EA4 - EasyApache Settings - PHP - name: Web Server Management tags: - Application Manager - ModSecurity - NginxCaching - PHP Settings - Web Apps - name: Website Configuration tags: - Handler Management - Logs - Mime Type Management - Nova - Site Information - Site Installation - Sitejet - WPX