Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

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. 

Include Page
LIB:_EA4Note
LIB:_EA4Note

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleJSON API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/php_ini_get_directives?api.version=1&version=ea-php54
Expand
titleXML API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/php_ini_get_directives?api.version=1&version=ea-php54
Expand
titleCommand Line
Code Block
languagebash
whmapi1 php_ini_get_directives version=ea-php54

Include Page
_WHMAPI1CLINote
_WHMAPI1CLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{
   "data":{
      "directives":[
         {
            "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.",
            "default_value":"1",
            "value":"On",
            "type":"boolean",
            "key":"allow_url_fopen"
         },
         {
            "info":"The maximum size of an uploaded file.",
            "default_value":"2M",
            "value":"2M",
            "type":"integer",
            "key":"upload_max_filesize"
         }
      ]
   },
   "metadata":{
      "version":1,
      "reason":"Ok",
      "result":1,
      "command":"php_ini_get_directives"
   }
}
Expand
titleOutput (XML)
Code Block
languagetext
linenumberstrue
<result>
   <data>
      <directives>
         <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.</info>
         <default_value>1</default_value>
         <value>On</value>
         <type>boolean</type>
         <key>allow_url_fopen</key>
      </directives>
      <directives>
         <info>This option allows the use of URL-aware fopen wrappers with the following functions: include(), include_once(), require(), require_once().</info>
         <default_value>0</default_value>
         <value>Off</value>
         <type>boolean</type>
         <key>allow_url_include</key>
      </directives>
     </data>
   <metadata>
      <version>1</version>
      <reason>Ok</reason>
      <result>1</result>
      <command>php_ini_get_directives</command>
   </metadata>
</result>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

Parameters  

Parameter
Type
Description
Possible values
Example
versionstring

Required

The name of an installed version of PHP.

  • ea-php53
  • ea-php54
  • ea-php55
  • ea-php56
  • A custom PHP package name.
ea-php54


Returns

ReturnTypeDescriptionPossible valuesExample

directives

array of hashesAn array of directives that are available in the php.ini file of the selected version of PHP.

This array includes the info, default_value, value, type, key, and php_ini_mode returns.

 

info

string

The purpose of the directive.

The function returns this value in the directives hash.

Any string that describes a directive.
Expand
titleClick to view...
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.

default_value

string

The directive's default value.

The function returns this value in the directives hash.

Any valid default value.1

value

string

The directive's current value.

The function returns this value in the directives hash.

Any valid current value.On

type

string

The type of value that the directive uses.

The function returns this value in the directives hash.

  • string
  • boolean
  • integer
  • float
boolean

key

string

The directive's name.

The function returns this value in the directives hash.

A valid PHP directive name.allow_url_fopen

php_ini_mode

string

The directive's PHP_INI mode.

The function returns this value in the directives array.

Note
titleNote:

We introduced this return in cPanel & WHM version 68. 

  • PHP_INI_SYSTEM
  • PHP_INI_PERDIR
  • PHP_INI_ALL
  • PHPINI_ONLY
PHP_INI_SYSTEM