PHP Conference Nagoya 2025

php_ini_loaded_file

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

php_ini_loaded_fileRetrieve a path to the loaded php.ini file

Descrizione

php_ini_loaded_file(): string|false

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

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

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

Esempi

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';
}
?>

Il precedente esempio visualizzerà qualcosa simile a:

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

Vedere anche:

add a note

User Contributed Notes 2 notes

up
4
geekcom
5 years ago
To find your php.ini just run

php --ini
up
-2
Andy Dodd
9 years ago
Or you could use
php -i | grep php.ini
To Top