php_ini_loaded_file

(PHP 5 >= 5.2.4, PHP 7)

php_ini_loaded_fileRetrieve a path to the loaded php.ini file

Opis

php_ini_loaded_file ( void ) : string

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

Parametry

Ta funkcja nie posiada parametrów.

Zwracane wartości

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

Przykłady

Przykład #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';
}
?>

Powyższy przykład wyświetli coś podobnego do:

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

Zobacz też:

add a note add a note

User Contributed Notes 4 notes

up
4
Andy Dodd
8 years ago
Or you could use
php -i | grep php.ini
up
2
geekcom
4 years ago
To find your php.ini just run

php --ini
up
1
yc
7 years ago
you can also do:

php -i | grep "Configuration File"
up
-1
litelus
9 years ago
quick way to find the ini loaded for the cli
php -r "echo php_ini_loaded_file();"
To Top