cPanel API 2 Functions - PHPINI::getalloptions

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.

 

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=

 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/',
    
);

 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/',
    }
);

 cPanel Tag System (deprecated)

Warning:

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.

cPanel API 2 calls that use cPanel tags vary widely in code syntax and in their output. For more information, read our Deprecated cPanel Tag Usage documentation. Examples are only present in order to help developers move from the old cPanel tag system to our LiveAPI.

 

 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 (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/

 Note:

 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 thephp.ini file about the directive, if it exists.

A string.

 Enable the PHP scripting language engine under Apache. 

value

string

The directive's current option.

A string.

On

 commented 

 boolean 

 Whether the directive is disabled (commented out) in the php.ini file. 

  • 1 — Commented out.
  • 0 — Not commented out.

0

subsection

string

The php.ini file subsection that contains the directive.

A string.

Language Options

directive

string

The PHP directive.

 A PHP directive that you included in thedirlist input parameter. 

engine

section

string

The php.ini file section.

A string.

PHP

reason

string

A reason for failure.

Note:

This function only returns a reasonvalue 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

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....