UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
This function changes the contents of a virtual host's php.ini file.
Note:
This document only applies to systems that run EasyApache 4 with MultiPHP enabled.
Important:
When you disable the WebServer role, the system disables this function.
The content of the php.ini file to change.
The type of php.ini file.
homevhost
Important:
If you set this parameter to vhost, you must also include the vhost parameter.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/LangPHP/php_ini_set_user_content
- A server running cPanel.
https://cpanel-server.tld:2083/execute/LangPHP/php_ini_set_user_content
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
uapi --output=jsonpretty \
--user=username \
LangPHP \
php_ini_set_user_content \
type='vhost' \
content='%5BPHP%5D%0D%0A%3B+About+php.ini%0D%0A%3B+php.ini+is+responsible+for+configuring+many+of+the+aspects+of+PHP%27s+behavior.%0D%0Apcre.backtrack_limit%3D100000'{ "apiversion": 3, "func": "php_ini_set_user_content", "module": "LangPHP", "result": { "data": {}, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function sets a virtual host's PHP version.
Note:
This document only applies to systems that run EasyApache 4.
Important:
When you disable the WebServer role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/LangPHP/php_set_vhost_versions
- A server running cPanel.
https://cpanel-server.tld:2083/execute/LangPHP/php_set_vhost_versions
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
uapi --output=jsonpretty \
--user=username \
LangPHP \
php_set_vhost_versions \
version='ea-php72' \
vhost='example.com'{ "apiversion": 3, "func": "php_set_vhost_versions", "module": "LangPHP", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }