UAPI Functions - LangPHP::php_ini_get_user_basic_directives

Description

This function lists a virtual host's basic PHP directives. The Basic Mode section of cPanel's MultiPHP INI Editor interface (Home >> Software >>MultiPHP INI Editor) also lists these directives.

Note:

This document only applies to systems that run EasyApache 4.

 

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/LangPHP/php_ini_get_user_basic_directives?type=vhost&vhost=clearly.com

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// Retrieve the basic PHP directives for a virtual host.
$php_ini_get_user_basic_directives $cpanel->uapi(
    'LangPHP''php_ini_get_user_basic_directives',
    array(
        'type'     => 'vhost'
        'vhost'   => 'clearly.com',
        )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# Retrieve the basic PHP directives for a virtual host.
my $php_ini_get_user_basic_directives $cpliveapi->uapi(
    'LangPHP''php_ini_get_user_basic_directives',
    (
        'type'     => 'vhost',
        'vhost'   => 'clearly.com',
        )
);

 cPanel Template Toolkit

<!-- Get a hash of the data, then display the key values. -->
[% data = execute( 'LangPHP', 'php_ini_get_user_basic_directives', {'type' => 'vhost', 'vhost' => 'clearly.com'} ); %]
[% FOREACH q = data.key %]
     <p>
         [% q.key %]
     </p>
[% END %]
    
<!-- Get only the default_value value. -->
[% execute('LangPHP', 'php_ini_get_user_basic_directives', {'type' => 'vhost', 'vhost' => 'clearly.com'} ).data.default_value %]

 Command Line

uapi --user=username LangPHP php_ini_get_user_basic_directives type=vhost vhost=clearly.com

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{ 
      "LangPHP":{ 
         "vhost":"clearly.com",
         "phpversion":"ea-php55",
         "type":"vhost",
         "path":"/home/allthethings/public_html/php.ini"
      }
   },
   "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"
         },
      ]
   }
}

 

Note:

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

 

Parameters

 Parameter 

Type

Description

Possible values

Example

type

 string 

Required

The type of php.ini file.

Important:

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

  • home
  • vhost

vhost

vhost

string

The name of a virtual host.

Important:

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

 A virtual host on the system. 

 

 clearly.com 

 

Returns

Return

Type

Description

Possible values

Example

directives

 array of hashes 

 An array of the available directives in the php.ini file of the selected user's PHP version. 

 This array includes theinfo, default_value, value, type, and key returns. 

 

info

 string

The purpose of the directive.

The function returns this value in the directives array.

A valid string.

 

 default_value 

string 

The directive's default value.

The function returns this value in the directives array.

Any valid default value of the following types:

  • integer
  • string
  • Boolean
  • float

 1

value

 string

The directive's current value.

The function returns this value in the directives array.

Any valid current value.

On

type

 string

The type of value that the directive uses.

The function returns this value in the directives array.

  • string
  • boolean
  • integer
  • float

 boolean

key

 string

The directive's name.

The function returns this value in the directives array.

A valid PHP directive name.

 allow_url_fopen 

 

  • 14 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....