-1

I just installed PHP, Apache and MySQL, did some changes to the configuration files and it works but phpinfo() says it looks for php.ini in C:\Windows. How to make it look somewhere else? Should I configure this in Apache? I put:

SetEnv PHPRC "C:/wamp/php5.6.5"

in http.conf, restared Apache but it didn't help. I know that programs like WampServer use phpForApache.ini instead of php.ini but I don't know how they do this.

Tom
  • 2,962
  • 3
  • 39
  • 69

1 Answers1

-1

Taken word for word from the docs...

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).

Machavity
  • 30,841
  • 27
  • 92
  • 100
castis
  • 8,154
  • 4
  • 41
  • 63
  • Changing registry is not a good solution, so I went with this option instead: http://stackoverflow.com/questions/9269083/set-path-to-php-ini – Tom Feb 05 '15 at 18:57
  • As WAMPServer has the ability to switch between many versions of PHP this is NOT a good solution in a WAMPServer environment. Also it is completely unnecessary. – RiggsFolly Feb 06 '15 at 09:45
  • 1
    @Tom, for future reference, if an answer is not acceptable. Do not accept it. – castis Feb 06 '15 at 18:13