UAPI Functions - LangPHP::php_ini_get_user_paths

Description

This function lists the php.ini file paths for the user's home directory and virtual host document roots.

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_paths

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List PHP INI file paths.
$php_ini_get_user_paths $cpanel->uapi(
    'LangPHP''php_ini_get_user_paths'
   );

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List PHP INI file paths.
my $php_ini_get_user_paths $cpliveapi->uapi(
    'LangPHP''php_ini_get_user_paths',
  );

 cPanel Template Toolkit

<!-- List PHP INI file paths. -->
[% execute( 'LangPHP', 'php_ini_get_user_paths' ) %]

 Command Line

uapi --user=username LangPHP php_ini_get_user_paths

 

Notes:

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

 Output (JSON)

{
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{
   },
   "data":{
      "paths":[
         {
            "documentroot":"/home/allthethings/public_html",
            "version":"ea-php55",
            "account":"allthethings",
            "path":"php.ini",
            "main_domain":1,
            "homedir":"/home/allthethings",
            "vhost":"clearly.com",
            "type":"vhost"
         },
         {
            "documentroot":"/home/allthethings/public_html/see",
            "version":"ea-php55",
            "account":"allthethings",
            "path":"php.ini",
            "main_domain":0,
            "homedir":"/home/allthethings",
            "vhost":"see.clearly.com",
            "type":"vhost"
         },
         {
            "documentroot":"/home/allthethings/public_html/speak",
            "version":"inherit",
            "account":"allthethings",
            "path":"php.ini",
            "main_domain":0,
            "homedir":"/home/allthethings",
            "vhost":"speak.clearly.com",
            "type":"vhost"
         },
         {
            "account":"allthethings",
            "version":"ea-php55",
            "path":"php.ini",
            "homedir":"/home/allthethings",
            "type":"home"
         }
      ]
   }
}

 

Note:

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

 

Parameters

This function does not accept parameters.

Returns

Return

Type

Description

Possible values

Example

paths

 array of hashes 

An array of hashes of php.ini file information.

 An array of hashes that contains thedocumentroot, version, account, path,main_domain, homedir, vhost, and typereturns. 

 

documentroot

string

The virtual host's document root.

The function returns this value in the paths array.

A valid document root path.

 /home/allthethings/public_html 

version

string

The default PHP version.

The function returns this value in the paths array.

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

ea-php55

account

string

The account's name.

The function returns this value in the paths array.

A valid cPanel account on the server.

allthethings

path

string

The name of the virtual host'sphp.ini file.

The function returns this value in the paths array.

A valid php.ini filename.

php.ini

 main_domain 

Boolean

 Whether the virtual host is the account's primary domain. 

The function returns this value in the paths array.

  • 1 — Primary domain.
  • 0 — Not the primary domain.

1

homedir

string

The home directory.

The function returns this value in the paths array.

A valid home directory path.

/home/allthethings/

vhost

string

The name of the virtual host.

The function returns this value in the paths array.

A valid hostname.

clearly.com

type

string

The record's type.

The function returns this value in the paths array.

  • home
  • vhost

vhost

 

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