Return PHP version's directives

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.

SecurityBasicAuth
Request
query Parameters
version
required
string

The name of an installed version of PHP.

  • ea-php72
  • ea-php73
  • ea-php74
  • Any custom PHP package name
Example: version=ea-php74
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/php_ini_get_directives
Request samples
whmapi1 --output=jsonpretty \
  php_ini_get_directives \
  version='ea-php74'
Response samples
application/json
{
  • "data": {
    • "directives": [
      • {
        • "default_value": "1",
        • "info": "This option enables the URL-aware fopen wrappers that enable accessing URL object like files. Default wrappers are provided for the access of remote files using the ftp or http protocol, some extensions like zlib may register additional wrappers.",
        • "key": "allow_url_fopen",
        • "php_ini_mode": "PHP_INI_SYSTEM",
        • "type": "boolean",
        • "value": "On"
        }
      ]
    },
  • "metadata": {
    • "command": "php_ini_get_directives",
    • "reason": "Ok",
    • "result": 1,
    • "version": 1
    }
}