Ever needed to make a quick adjustment to the php.ini file but you weren’t sure where it was? Here’s a quick command you can use:

php -i | grep php.ini

What this does is tell the php command-line application to run a phpinfo() and output it in text format to the shell. Then filtering it through grep to find the actual line, which will display like so:

Configuration File (php.ini) Path => /etc/php.ini

You can, of course, always put a new php file in your web server root directory and add in the following:



And then browse to it in your browser.

Profile Photo for Lowell Heddings Lowell Heddings
Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work.
Read Full Bio »