php_ini_loaded_file()

php_ini_loaded_file() — Retrieve a path to the loaded php.ini file.

Built-in function of PHP 8.5. The manual lists it as available in PHP 5 >= 5.2.4, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

Signature

php_ini_loaded_file(): string|false

Parameters

This function takes no parameters.

Return value

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

Example

A runnable snippet:

$inipath = php_ini_loaded_file(); if ($inipath) { echo 'Loaded php.ini: ' . $inipath; } else { echo 'A php.ini file is not loaded'; }

Output:

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

See also

php_ini_scanned_files(), phpinfo()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page php_ini_loaded_file() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.