WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
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 } }
Request
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_ini_set_content
- A server running WHM.
https://whm-server.tld:2087/json-api/php_ini_set_content
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_ini_set_content?content=%5BPHP%5D%0A%3B+About+php.ini%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0Apcre.backtrack_limit%3D100000%0A&version=ea-php74'{ "data": {}, "metadata": { "command": "php_ini_set_content", "reason": "Ok", "result": 1, "version": 1 } }
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
- 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_set_directives?directive=string&version=ea-php72'{ "data": {}, "metadata": { "command": "php_ini_set_directives", "reason": "Ok", "result": 1, "version": 1 } }