php_ini_loaded_file : the path of php.ini file

Find the loaded php.ini file

php_ini_loaded_file() returns the path of the active php.ini file, or false when no configuration file is loaded.

<?php
$file = php_ini_loaded_file();
echo $file !== false ? $file : 'No php.ini loaded';


Getting & setting PHP values of php.ini and getting server, operating system & PHP details to Manage
echo php_ini_loaded_file()
Output is True or False and the path is returned if php.ini file is loaded.
$path = php_ini_loaded_file();

if ($path) {
    echo 'Path of  php.ini: ' . $path;
} else {
    echo 'No php.ini file is loaded';
}
Output is
Path of php.ini: C:\php\php.ini
You can get the path of php.ini by using php_info()
Introduction to PHP Change some of php.ini settings by using ini_set() ini_get() Guide to installation and How to write our first PHP Script



Subscribe to our YouTube Channel here



plus2net.com











PHP video Tutorials
✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer