如何设置php.ini位置?
How to set php.ini location?
我刚刚安装了 PHP、Apache 和 MySQL,对配置文件做了一些更改并且它可以工作,但是 phpinfo() 说它在 C:\[ 中寻找 php.ini =22=]。
如何让它看起来在别处?我应该在 Apache 中配置它吗?我输入:
SetEnv PHPRC "C:/wamp/php5.6.5"
在 http.conf 中,重新启动了 Apache 但没有帮助。我知道像 WampServer 这样的程序使用 phpForApache.ini 而不是 php.ini 但我不知道他们是怎么做到的。
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).
我刚刚安装了 PHP、Apache 和 MySQL,对配置文件做了一些更改并且它可以工作,但是 phpinfo() 说它在 C:\[ 中寻找 php.ini =22=]。 如何让它看起来在别处?我应该在 Apache 中配置它吗?我输入:
SetEnv PHPRC "C:/wamp/php5.6.5"
在 http.conf 中,重新启动了 Apache 但没有帮助。我知道像 WampServer 这样的程序使用 phpForApache.ini 而不是 php.ini 但我不知道他们是怎么做到的。
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).