简体   繁体   English

如何设置php.ini的位置?

[英]How to set php.ini location?

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. 我刚刚安装了PHP,Apache和MySQL,对配置文件进行了一些更改,并且可以运行,但是phpinfo()表示它将在C:\\ Windows中查找php.ini。 How to make it look somewhere else? 如何使它看起来在其他地方? Should I configure this in Apache? 我应该在Apache中配置它吗? I put: 我放:

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

in http.conf, restared Apache but it didn't help. 在http.conf中,重新命名为Apache,但没有帮助。 I know that programs like WampServer use phpForApache.ini instead of php.ini but I don't know how they do this. 我知道像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. 从PHP 5.2.0开始,可以为不同版本的PHP设置php.ini文件的位置。 The following registry keys are examined in order: [HKEY_LOCAL_MACHINE\\SOFTWARE\\PHP\\xyz], [HKEY_LOCAL_MACHINE\\SOFTWARE\\PHP\\xy] and [HKEY_LOCAL_MACHINE\\SOFTWARE\\PHP\\x], where x, y and z mean the PHP major, minor and release versions. 依次检查以下注册表项:[HKEY_LOCAL_MACHINE \\ SOFTWARE \\ PHP \\ xyz],[HKEY_LOCAL_MACHINE \\ SOFTWARE \\ PHP \\ xy]和[HKEY_LOCAL_MACHINE \\ SOFTWARE \\ PHP \\ x],其中x,y和z表示PHP专业语言,次要版本和发行版本。 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). 如果这些键中的任何一个都有IniFilePath的值,则找到的第一个键将用作php.ini的位置(仅Windows)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM