Where is my php.ini?

A new and easy trick to find your php.ini would be to ask php itself what it’s using, eg:

/usr/local/bin/php -i | grep ‘Loaded Configuration File’

which does assume that the php output will be in English.


If you’re running the default version of CLI php, your php.ini will be located at:

/usr/local/lib/php.ini

If you’re running php5 in CGI mode (suPhp), your php.ini will be located at:

/usr/local/etc/php5/cgi/php.ini

If you’re running php4 in CGI mode (suPhp), your php.ini will be located at:

/usr/local/etc/php4/cgi/php.ini

If you’re running php5.4 in php-FPM mode, your php.ini will be located at:

/usr/local/php54/lib/php.ini

Leave a comment