Questions

Forum Navigation
Please to create posts and topics.

Find PHP (php.ini) Configuration File on Linux

How to find easily the location of the php.ini configuration file on a Linux system?

PHP can be controlled from the terminal using php command line utility, in conjunction with the -i switch which enables showing of PHP information and configurations and used together with the grep command this will help us to can find the PHP configuration file location like so:

$ php -i | grep "Loaded Configuration File"

The ouput will be something like the following:

Loaded configuration file => /etc/php.ini