php_ini_loaded_file

(PHP 5 >= 5.2.4, PHP 7)
Retrieve a path to the loaded php.ini file
string php_ini_loaded_file ( void )

Check if a php.ini file is loaded, and retrieve its path.

Returns:

The loaded php.ini path, or FALSE if one is not loaded.

Examples:
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() -

phpinfo() -

The configuration file -

doc_php
2016-02-24 15:54:02
Comments
Leave a Comment

Please login to continue.