How to find PHP Configuration file location in Linux
How to find PHP Configuration file location in Linux, if you are on Linux and want to know the location of PHP configuration file. Then execute these below commands in terminal to get the exact php configuration file or php.ini file. Otherwise create a php file and place phpinfo() function, run this file in browser to get php.ini file location.
Execute these commands in terminal, before that login into linux server. Then use these commands
php -i | grep "Loaded Configuration File"
And Output will be something like this Loaded Configuration File => /etc/php.ini.
Creating PHP file
Create a php file and place this below code
<?php phpinfo(); ?>
Run this file from browser, and you can see the php.ini location under: “Loaded Configuration File”.