How to get the php.ini file path in PHP?
PHP

How to get the php.ini file path in PHP?

Sometimes, we need to check the php.ini file location for configuration. In this article, I am sharing with you, how can you easily find the php.ini file location.

You can get location by using php_ini_loaded_file() of PHP.

Example:

<?php
//print php.ini file location
print_r(php_ini_loaded_file());
?>

The output look similar below in the ubuntu system:

 

/etc/php74/apache2/php.ini

Get The latest Coding solutions.

Subscribe to the Email Newsletter