cPanel API 2 Functions - PHPINI::getalloptions

Warning:

The cPanel API 2 system is deprecated. We strongly recommend that you use UAPI instead of cPanel API 2.

Description

This function retrieves a PHP configuration file's list of options.

Warning:

We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.

Important:

In cPanel & WHM version 76 and later, when you disable the Web Server role, the system disables this function.


Examples


WHM API (JSON)

https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=PHPINI&cpanel_jsonapi_func=getalloptions&php_prefix="%2Fusr%2Flocal%2Fcpanel%2F3rdparty%2F"
Note:

For more information, read our Calls from the WHM API documentation.


LiveAPI PHP Class

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// Get PHP configuration info.
$get_php_config = $cpanel->api2(
    'PHPINI', 'getalloptions',
    array(
        'php_prefix'    => '/usr/local/cpanel/3rdparty/',
    )
);
Note:

For more information, read our Guide to the LiveAPI System.


LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.

# Get PHP configuration info.
my $get_php_config = $cpliveapi->api2(
    'PHPINI', 'getalloptions',
    {
        'php_prefix'    => '/usr/local/cpanel/3rdparty/',
    }
);
Note:

For more information, read our Guide to the LiveAPI System.


cPanel Tag System (deprecated)

Warnings:
  • In cPanel & WHM version 11.30 and later, cPanel tags are deprecated . We strongly recommend that you only use the LiveAPI system to call the cPanel APIs. Examples are only present in order to help developers move from the old cPanel tag system to our LiveAPI .
  • cPanel API 2 calls that use cPanel tags vary in code syntax and in their output.
  • For more information, read our Deprecated cPanel Tag Usage documentation.

Command Line

cpapi2 --user=username PHPINI getalloptions
Notes:
  • You must URI-encode values.
  • username represents your account-level username.
  • You must include the --user=username option.
  • For more information and additional output options, read our Guide to cPanel API 2 documentation or run the cpapi2 --help command.
  • If you run CloudLinux™, you must use the full path of the cpapi2 command:
    /usr/local/cpanel/bin/cpapi2

Output (JSON)

{
  "cpanelresult": {
    "apiversion": 2,
    "func": "getalloptions",
    "data": [
      {
        "dirlist": [
          {
            "info": "User-function to be called if an assertion fails.",
            "value": "0",
            "commented": 1,
            "subsection": "main",
            "directive": "assert.callback",
            "section": "Assertion"
          },
          {
            "info": "Issue a PHP warning for each failed assertion.",
            "value": "On",
            "commented": 1,
            "subsection": "main",
            "directive": "assert.warning",
            "section": "Assertion"
          },
          {
            "info": "Eval the expression with current error_reporting().  Set to true if you want\n error_reporting(0) around the eval().",
            "value": "0",
            "commented": 1,
            "subsection": "main",
            "directive": "assert.quiet_eval",
            "section": "Assertion"
          },
          {
            "info": "Assert(expr); active by default.",
            "value": "On",
            "commented": 1,
            "subsection": "main",
            "directive": "assert.active",
            "section": "Assertion"
          },
          {
            "info": "Don't bail out by default.",
            "value": "Off",
            "commented": 1,
            "subsection": "main",
            "directive": "assert.bail",
            "section": "Assertion"
          }
        ],
        "section": "Assertion"
      },
      {
        "dirlist": [
          {
            "info": "Modify the setting below to match the directory location of the cracklib\n dictionary files.  Include the base filename, but not the file extension.",
            "value": "c:\\php\\lib\\cracklib_dict",
            "commented": 1,
            "subsection": "main",
            "directive": "crack.default_dictionary",
            "section": "Crack"
          }
        ],
        "section": "Crack"
      },
      {
        "dirlist": [
          {
            "info": "",
            "value": "128",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.max_results",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.default_database_password",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.default_database",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "On",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.autocommit",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "On",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.allow_persistent",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "128",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.max_connections",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "1000",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.batchSize",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "_SYSTEM",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.default_user",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "128",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.max_links",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.default_password",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "-1",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.max_persistent",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "Off",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.generate_warnings",
            "section": "FrontBase"
          },
          {
            "info": "",
            "value": "",
            "commented": 1,
            "subsection": "main",
            "directive": "fbsql.default_host",
            "section": "FrontBase"
          }
        ],
        "section": "FrontBase"
      },
      {
        "dirlist": [
          {
            "info": "Allow or prevent persistent links.",
            "value": "On",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.allow_persistent",
            "section": "Informix"
          },
          {
            "info": "Trailing blanks are stripped from fixed-length char columns.  May help the\n life of Informix SE users.",
            "value": "0",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.charasvarchar",
            "section": "Informix"
          },
          {
            "info": "Maximum number of links (persistent + non-persistent).  -1 means no limit.",
            "value": "-1",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.max_links",
            "section": "Informix"
          },
          {
            "info": "Default host for ifx_connect() (doesn't apply in safe mode).",
            "value": "",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.default_host",
            "section": "Informix"
          },
          {
            "info": "Default user for ifx_connect() (doesn't apply in safe mode).",
            "value": "",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.default_user",
            "section": "Informix"
          },
          {
            "info": "NULL's are returned as empty strings, unless this is set to 1.  In that case,\n NULL's are returned as string 'NULL'.",
            "value": "0",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.nullformat",
            "section": "Informix"
          },
          {
            "info": "If on, select statements return the contents of a byte blob instead of its id.",
            "value": "0",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.byteasvarchar",
            "section": "Informix"
          },
          {
            "info": "Maximum number of persistent links.  -1 means no limit.",
            "value": "-1",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.max_persistent",
            "section": "Informix"
          },
          {
            "info": "If on, the contents of text and byte blobs are dumped to a file instead of\n keeping them in memory.",
            "value": "0",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.blobinfile",
            "section": "Informix"
          },
          {
            "info": "Default password for ifx_connect() (doesn't apply in safe mode).",
            "value": "",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.default_password",
            "section": "Informix"
          },
          {
            "info": "If on, select statements return the contents of a text blob instead of its id.",
            "value": "0",
            "commented": 0,
            "subsection": "main",
            "directive": "ifx.textasvarchar",
            "section": "Informix"
          }
        ],
        "section": "Informix"
      },
      {
        "dirlist": [
          {
            "info": "Maximum number of links, including persistents.  -1 means no limit.",
            "value": "-1",
            "commented": 0,
            "subsection": "main",
            "directive": "ingres.max_links",
            "section": "Ingres II"
          },
          {
            "info": "Maximum number of persistent links.  -1 means no limit.",
            "value": "-1",
            "commented": 0,
            "subsection": "main",
            "directive": "ingres.max_persistent",
            "section": "Ingres II"
          },
          {
            "info": "Default user.",
            "value": "",
            "commented": 0,
            "subsection": "main",
            "directive": "ingres.default_user",
            "section": "Ingres II"
          },
          {
            "info": "Allow or prevent persistent links.",
            "value": "On",
            "commented": 0,
            "subsection": "main",
            "directive": "ingres.allow_persistent",
            "section": "Ingres II"
          },
          {
            "info": "Default password.",
            "value": "",
            "commented": 0,
            "subsection": "main",
            "directive": "ingres.default_password",
            "section": "Ingres II"
          },
          {
            "info": "Default database (format: [node_id::]dbname[\/srv_class]).",
            "value": "",
            "commented": 0,
            "subsection": "main",
            "directive": "ingres.default_database",
            "section": "Ingres II"
          }
        ],
        "section": "Ingres II"
      }
    ],
    "event": {
      "result": 1
    },
    "module": "PHPINI"
  }
}
Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.


Parameters

Parameter Type Description Possible values Example
php_prefix string

The PHP installation to query.

This parameter defaults to /usr/local/.

  • /usr/local/
  • /usr/local/php4/
  • /usr/local/cpanel/3rdparty/

In WHM API calls, replace each forward slash character with %2F.

/usr/local/cpanel/3rdparty/

Returns

Return Type Description Possible values Example
info string Information from the php.ini file about the directive, if it exists. A valid string. Enable the PHP scripting language engine under Apache.
value string The directive's current option. A valid string. On
commented Boolean Whether the directive is disabled (commented out) in the php.ini file.
  • 1 — Commented out.
  • 0Not commented out.
0
subsection string The php.ini file subsection that contains the directive. A valid string. Language Options
directive string The PHP directive. A PHP directive that you included in the dirlist input parameter. engine
section string The php.ini file section. A valid string. PHP
reason string

A reason for failure.

This function only returns a reason value if it failed.

A string that describes the error.

This is an error message.
result Boolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1