Update basic PHP directives

This function sets the values of any basic PHP directive. The Basic Mode section of cPanel's MultiPHP INI Editor interface (WHM >> Home >> Software >> MultiPHP INI Editor) lists these directives.

Note:

This document only applies to systems that run EasyApache 4 with MultiPHP enabled.

Important:

When you disable the Web Server role, the system disables this function.

SecurityBasicAuth
Request
query Parameters
directive
required
string

The name of a PHP directive and its value.

Note:

  • To change the directive's value for multiple PHP directives, increment the parameter name. For example, the directive-1directive-2, and directive-3 parameters.
  • You must format values as <directive>:<value>
Examples:
directive=directive-1=allow_url_fopen%3A0&directive-2=upload_max_filesize%3A4M&directive-3=post_max_size
directive=allow_url_fopen:0
type
required
string

The type of php.ini file.

  • home
  • vhost

Important:

If you set this parameter to vhost, you must also include the vhost parameter.

Enum: "home" "vhost"
Example: type=vhost
vhost
string <domain>

The name of a virtual host.

Important:

If the type value is vhost, you must use this parameter.

Example: vhost=clearly.com
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/LangPHP/php_ini_set_user_basic_directives
Request samples
uapi --output=jsonpretty \
  --user=username \
  LangPHP \
  php_ini_set_user_basic_directives \
  type='vhost' \
  directive='allow_url_fopen:0'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "php_ini_set_user_basic_directives",
  • "module": "LangPHP",
  • "result": {
    • "data": null,
    • "errors": null,
    • "messages": null,
    • "metadata": {
      • "LangPHP": {
        • "path": "/home/allthethings/public_html/php.ini",
        • "phpversion": "ea-php55",
        • "type": "vhost",
        • "vhost": "clearly.com"
        }
      },
    • "status": 1,
    • "warnings": null
    }
}