Find ini file used by PHP configuration

If you have multiple PHP configurations on the same system, while at the same time using the command-line interface and a web interface, it can be useful to be able to find out which .ini file is being used at that time in that situation.

Windows and Linux differ slightly, as the helper tools have a different name. The technique is twice the same : parse the output of the “php -i” command.

Windows:

php -i | find /i "Configuration File"

Linux:

php -i | grep 'Configuration File'

There you go, I hope this is useful someday!

Leave a Reply