php8.5
Home/ Manual/ info / functions/ php_ini_loaded_file

php_ini_loaded_file

PHP function Edit on GitHub ✎

(PHP 5 >= 5.2.4, PHP 7, PHP 8)

Retrieve a path to the loaded php.ini file

Description

php_ini_loaded_file(): string|false

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

Parameters Parameters

Return Values

The loaded Ini path, or false if one is not loaded.

Examples

php_ini_loaded_file() example

php
<?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:

output
Loaded php.ini: /usr/local/php/php.ini

See Also

Source: reference/info/functions/php-ini-loaded-file.xml · from the official PHP manual (php/doc-en)