WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
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.
The name of a PHP directive and its value.
Note:
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_ini_set_directives
- A server running WHM.
https://whm-server.tld:2087/json-api/php_ini_set_directives
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
php_ini_set_directives \
directive='allow_url_fopen:0' \
version='ea-php72'{ "data": {}, "metadata": { "command": "php_ini_set_directives", "reason": "Ok", "result": 1, "version": 1 } }
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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
php_set_handler \
version='ea-php70' \
handler='suphp'{ "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
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
php_set_session_save_path{ "metadata": { "command": "php_set_session_save_path", "reason": "OK", "result": 1, "version": 1 } }