Page tree
Skip to end of metadata
Go to start of metadata

 

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

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

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

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.
 
# List PHP INI file paths.
my $php_ini_get_user_paths = $cpliveapi->uapi(
    'LangPHP', 'php_ini_get_user_paths',
  );

Note:

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

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

Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username LangPHP php_ini_get_user_paths

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 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 (cPanel >> 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 hashesAn array of hashes of php.ini file information.

An array of hashes that contains the documentroot, version, account, path, main_domain, homedir, vhost, and type returns.

 

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-php54
  • ea-php55
  • ea-php56
  • ea-php70
  • ea-php71
  • 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's php.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