15

I was looking for a way to change the max file size in phpmyadmin (mysql imports). I solved it after discovering there were two php.ini files: one is located at C:\wamp\bin\apache\Apache2.4.4\bin considering the default install path, while the other one is at C:\wamp\bin\php\php5.4.16.

The funny aspect here is that, when I want to change variables, I should pay attention to the apache/-located php.ini file, instead of the php/-located one.

And here comes my question: why? Why are there two php.ini files instead of one? I must even look at both files, depending on what do I need to change (and I'm NEVER sure what file should I look, but by trial and error). What's the purpose, and when should I look either file?

j0k
  • 22,600
  • 28
  • 79
  • 90
Luis Masuelli
  • 12,079
  • 10
  • 49
  • 87
  • 1
    phpinfo() will tell you what ini file(s) it's loading and where it's looking for more – Mike B Mar 31 '14 at 20:02
  • why only 2? depending on setup you could have one in every directory. –  Mar 31 '14 at 20:03
  • Ok but I had no per-directory php.ini files. That's why I was asking about. – Luis Masuelli Mar 31 '14 at 20:06
  • possible duplicate of [WAMPserver - why is the stack installed with 2 php.ini files?](http://stackoverflow.com/questions/9446832/wampserver-why-is-the-stack-installed-with-2-php-ini-files) – Mojtaba Rezaeian Jul 03 '15 at 12:56

1 Answers1

24

The one from Apache folder is used for the web and the one from the PHP folder is used for the CLI.

If you want to update something on your php.ini related to a problem / an improvement on the web, you should update the one inside the Apache folder.

If you need some fine tuning on a task, which is launched using the CLI version of PHP, you should update the one in the PHP folder.

j0k
  • 22,600
  • 28
  • 79
  • 90
  • 1
    Thank you for explaining that and not just shrugging this question off as a stupid newb question, as so many seem to have done. – Captain Hypertext Feb 29 '16 at 19:22
  • This is not so on my installation. For some reason the php.ini in the PHP folder is used for the web, but when I open the php.ini through the Wamp taskbar icon it opens the one located in the apache folder – Charon ME Jan 31 '22 at 11:05