Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 7
    This only works, if there is a php.ini, which is exactly the problem: If there is none, you still don't know where to look at, or where to place a new one. Commented Aug 8, 2013 at 20:30
  • I've never come across a situation where there is no php.ini file. Commented Dec 30, 2013 at 14:46
  • Running this command gives me Configuration File (php.ini) Path => /usr/lib, but running <?php phpinfo(); ?> gives me Loaded Configuration File: /etc/php.ini. So, phpinfo() was more reliable in my case. Commented Jun 13, 2014 at 18:35
  • 4
    This is not entirely correct. Every framework that uses the PHP language has it's own php.ini file. If you call that line from the command line, you will probably end up receiving something like /var/php5/cli/php.ini which is not the file used when running PHP on a web environment. For that file, you should look into the apache2 folder. Commented Jun 23, 2014 at 13:26
  • is possible get the output php -i | grep 'php.ini' from apache? (script.php) Commented Jan 11, 2022 at 15:38