Php – IIS Change PHP.ini location

iisiis-7PHP

I am a novice with IIS on Windows Server 2008

My question is basically how to change the path of PHP.ini, due to phpinfo(); my PHP configuration is loaded from C:\windows when I have my mapped module linked to:

C:\PHP5.4

So How would I go about changing this around, I have performed some research into this subject, but it has not provided me with a solution.

I am on WIndows Server 2008 Running IIS 6.0 with a mapped module of PHP5.4

Best Answer

In Windows, you can set the search location in the registry.

Via the PHP Configuration File:

  • As of PHP 5.2.0, the location of the php.ini file can be set for different versions of PHP. The following registry keys are examined in order: [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z], [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP major, minor and release versions. If there is a value for IniFilePath in any of these keys, the first one found will be used as the location of the php.ini (Windows only).
  • [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath (Windows only).
Related Topic