Retrieve a path to the loaded php.ini file (original) (raw)
php_ini_loaded_file
(PHP 5 >= 5.2.4, PHP 7)
php_ini_loaded_file — Retrieve a path to the loaded php.ini file
Description
php_ini_loaded_file ( void ) : string
Parameters
This function has no parameters.
Return Values
The loaded php.ini path, or FALSE
if one is not loaded.
Examples
Example #1 php_ini_loaded_file() example
`<?php
$inipath = php_ini_loaded_file();
if (
$inipath) {
echo 'Loaded php.ini: ' . $inipath;
} else {
echo 'A php.ini file is not loaded';
}
?> `
The above example will output something similar to:
Loaded php.ini: /usr/local/php/php.ini
See Also
- php_ini_scanned_files() - Return a list of .ini files parsed from the additional ini dir
- phpinfo() - Outputs information about PHP's configuration
- The configuration file