WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function retrieves the PHP INI directives and pool options for a system's or domain's PHP-FPM configuration.
Important:
When you disable the WebServer 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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_fpm_config_get
- A server running WHM.
https://whm-server.tld:2087/json-api/php_fpm_config_get
- 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_fpm_config_get \
-H 'Content-Type: application/json' \
-d '{
"domain": "example.com"
}'{ "data": { "config": [ … ] }, "metadata": { "command": "php_fpm_config_get", "reason": "OK", "result": 1, "version": 1 } }
Request
This function configures the PHP INI directives and pool options for a system's or domain's PHP-FPM configuration.
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.
An array of objects containing the PHP-FPM configuration values to validate or update.
A PHP INI directive or PHP-FPM pool option name.
PHP INI directives
allow_url_fopen- The PHP configuration treats URLs as files.disable_functions- Lists the functions that the system will disable.doc_root- The PHP pages' document root.error_log- The error log file.error_reporting- The errors that the system reports on.log_errors- Whether the system will log errors.short_open_tag- Whether the system recognizes code between the tags as a PHP source.
Pool options
pm_max_children- The maximum number of process pools that the PHP-FPM Master Process will generate to handle requests.pm_max_requests- The maximum number of requests that the process pools can receive.pm_process_idle_timeout- The amount of time, in seconds, that a pool process will wait for a request.
Whether the PHP value is a PHP INI directive value (php_value), a PHP INI ADMIN value (php_admin_value), or a PHP-FPM pool option (pm_*).
0- A PHP-FPM-specific value (pool options).1- A PHP INI ADMIN directive. A cPanel account user cannot override this directive.2- A PHP INI directive. A cPanel account user can override this directive.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_fpm_config_set
- A server running WHM.
https://whm-server.tld:2087/json-api/php_fpm_config_set
- 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_fpm_config_set \
-H 'Content-Type: application/json' \
-d '{
"config": [
{
"base_flag_name": "error_reporting",
"trinary_admin_value": 1,
"value": "E_ALL & ~E_NOTICE"
},
{
"base_flag_name": "pm_max_children",
"trinary_admin_value": 0,
"value": "10"
}
]
}'{ "metadata": { "command": "php_fpm_config_set", "reason": "OK", "result": 1, "version": 1 } }
Request
This function determines whether the system enables PHP-FPM for new domains and accounts.
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.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/php_get_default_accounts_to_fpm
- A server running WHM.
https://whm-server.tld:2087/json-api/php_get_default_accounts_to_fpm
- 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_default_accounts_to_fpm{ "data": { "default_accounts_to_fpm": 0 }, "metadata": { "command": "php_get_default_accounts_to_fpm", "reason": "OK", "result": 1, "version": 1 } }