WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_get_vhosts_by_version
- A server running WHM.
https://whm-server.tld:2087/json-api/php_get_vhosts_by_version
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_get_vhosts_by_version?version=ea-php56'{ "data": { "vhosts": [ … ] }, "metadata": { "command": "php_get_vhosts_by_version", "reason": "OK", "result": 1, "version": 1 } }
Request
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_ini_get_content
- A server running WHM.
https://whm-server.tld:2087/json-api/php_ini_get_content
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_ini_get_content?version=ea-php74'{ "data": { "content": "display_errors; Default Value: On; Development Value: On; Production Value: Off;" }, "metadata": { "command": "php_ini_get_content", "reason": "Ok", "result": 1, "version": 1 } }
Request
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_ini_get_directives
- A server running WHM.
https://whm-server.tld:2087/json-api/php_ini_get_directives
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_ini_get_directives?version=ea-php74'{ "data": { "directives": [ … ] }, "metadata": { "command": "php_ini_get_directives", "reason": "Ok", "result": 1, "version": 1 } }