I'm currently running CentOS and also have cpanel installed. I have root access to the server. When I do a 'locate php.ini', I get a page full of results.

enter image description here

Is there a way to find out which php.ini file is the current one?

Also what's the reason to why there are so many php.ini files littered all over the place.


Create a 'phpinfo' page with the extension '.php' using the following php code and put it under the 'Document Root' of any website on your server (the point is to load this same PHP file on a browser). Call it on a browser and search for 'php.ini' in the page that loads and it will show you with php.ini the server is using.

  • ok just did that and i get this: prntscr.com/4qj550 --- now there are 2 of them. "loaded config path" and "config file path" which one is the real one? and why did they do that? Sep 26 '14 at 17:31
  • It is "configuration file path" and "loaded configuration file" - what is unclear about it? One is the file in question, the other is the path where you'll find it.
    – peterph
    Sep 26 '14 at 19:31
  • oops sorry did not see that..! Sep 26 '14 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.