WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function sets a PHP version's handler.
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_set_handler
- A server running WHM.
https://whm-server.tld:2087/json-api/php_set_handler
- 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_set_handler?handler=suphp&version=ea-php70'{ "metadata": { "command": "php_set_handler", "reason": "OK", "result": 1, "version": 1 } }
Request
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_set_session_save_path
- A server running WHM.
https://whm-server.tld:2087/json-api/php_set_session_save_path
- 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_set_session_save_path?overwrite=0&path=%2Fvar%2Fcpanel%2Fphp%2Fsessions'{ "metadata": { "command": "php_set_session_save_path", "reason": "OK", "result": 1, "version": 1 } }
Request
The version of PHP that you wish to set as the system's default.
ea-php81inherit- Any custom PHP package name.
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_set_system_default_version
- A server running WHM.
https://whm-server.tld:2087/json-api/php_set_system_default_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_set_system_default_version?version=ea-php81'{ "metadata": { "command": "php_set_system_default_version", "reason": "Ok", "result": 1, "version": 1 } }