Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<memory_reset_peak_usagephp_ini_scanned_files>
^PHP Options/Info FunctionsLast updated: Mon, 26 Oct 2026

php_ini_loaded_file

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

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

Description

function php_ini_loaded_file(): string|false

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

Parameters

This function has no parameters.

Return Values

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

Examples

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

The above example will output something similar to:

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

See Also


<memory_reset_peak_usagephp_ini_scanned_files>
^PHP Options/Info FunctionsLast updated: Mon, 26 Oct 2026