Which php.ini - the one in the apache or php directory der?
Posted by: t22harris (98.125.225.---)
Date: April 03, 2011 10:24PM

There is a php.ini file in both the "apache" and the "php" directory folders. I went to set up browsercap.ini and it seems that when called by the server that the php.ini in the apache folder was needed but when running php from the command line that the php.ini in the php folder was used.

Is that how it is or do I have it wrong?

Options: ReplyQuote
Re: Which php.ini - the one in the apache or php directory der?
Posted by: stevenmartin99 (---.b-ras1.srl.dublin.eircom.net)
Date: April 03, 2011 10:42PM

There is actually 3 php.ini files in WampServer

This is how they are used...

1. C:\Wamp\bin\php\phpX.X.X\php.ini
This is only used by wampserver and php cli exe. WampServer's menu is built using php and this is the config file that is used. It is also used if you are using php through the command line interface. You generally never need to edit this file.

2. C:\Wamp\bin\php\phpX.X.X\phpforapache.ini
This is a copy of the php.ini file used for your websites. When this version of php is being used this file is copied into the apache bin folder. If you change version of php the apache\bin\php.ini is then emptied and the phpforapache.ini of the new version of php is loaded into whichever version of apache is loaded.

3. C:\Wamp\bin\apache\apacheX.X.X\bin\php.ini
This is the actual php.ini that is loaded for your websites. provided that this is the version of apache being used. This is copied from the relevant active php folder( phpforapache.ini).


This may seem a little confusing but it is nessecary for WampServer's ability to change version of apache and php easily. The best thing to remember is..

If you want to manually edit your php.ini file for websites then always use the wampserver menu to open it . >> left click the WampServer icon > php > php.ini

If you want to manually edit your php.ini file for command line then open php.ini in the current php folder.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 2 time(s). Last edit at 04/03/2011 10:44PM by stevenmartin99.

Options: ReplyQuote
Re: Which php.ini - the one in the apache or php directory der?
Posted by: t22harris (98.125.225.---)
Date: April 04, 2011 01:31AM

Great answer. Thanks!

Options: ReplyQuote


Sorry, only registered users may post in this forum.