简体   繁体   English

使用错误的php.ini文件

[英]Using the wrong php.ini file

I have installed php 5.6.0 locally on Windows 8.1 and IIS 8.5.9600.16384. 我已经在Windows 8.1和IIS 8.5.9600.16384上本地安装了php 5.6.0。

The php.ini file that I want it to use is in c:\\php 我要使用的php.ini文件在c:\\ php中

My PHPRC environment variable is set to c:\\php 我的PHPRC环境变量设置为c:\\ php

Registry entries HKEY_LOCAL_MACHINE\\SOFTWARE\\PHP\\5.6.0 > IniFilePath and HKEY_LOCAL_MACHINE\\SOFTWARE\\PHP > IniFilePath are also set to c:\\php 注册表项HKEY_LOCAL_MACHINE \\ SOFTWARE \\ PHP \\ 5.6.0> IniFilePath和HKEY_LOCAL_MACHINE \\ SOFTWARE \\ PHP> IniFilePath也设置为c:\\ php

php.exe is in C:\\Program Files (x86)\\PHP\\v5.6 php.exe位于C:\\ Program Files(x86)\\ PHP \\ v5.6中

phpinfo gives me: phpinfo给我:

Configuration File (php.ini) Path    C:\WINDOWS
Loaded Configuration File            C:\Program Files (x86)\PHP\v5.6\php.ini 

I have restarted IIS 我已经重启了IIS

My "path" environment variable contains C:\\Program Files (x86)\\PHP\\v5.6; 我的“路径”环境变量包含C:\\ Program Files(x86)\\ PHP \\ v5.6;

I have added c:\\php; 我添加了c:\\ php; to the "path" environment variable 到“路径”环境变量

I have rebooted my pc 我已经重启了我的电脑

What do I have to do to get it to use the php.ini in c:\\php ? 我要怎么做才能在c:\\ php中使用php.ini?

EDIT: After Ryan's suggestion of renaming the offending file, I now get: 编辑:在瑞安建议重命名有问题的文件后,我现在得到:

Detailed Error Information:
Module     FastCgiModule
Notification       ExecuteRequestHandler
Handler    PHP_via_FastCGI
Error Code     0x80070003
Requested URL      http://10.21.4.3:80/test/phpinfo.php
Physical Path      C:\IIS_Emea\WebRoot\Site01\test\phpinfo.php
Logon Method       Anonymous
Logon User     Anonymous

I uninstalled php and installed it manually instead. 我卸载了php并手动进行了安装。 Now I have more control, a better understanding and a working php 5.6. 现在,我有了更多的控制权,有了更好的理解,并且可以使用PHP 5.6。

I had Wampserver installed and then switched to nginx, so Wampserver was still holding php. 我安装了Wampserver,然后切换到Nginx,因此Wampserver仍然持有php。 I was expecting it to be using c:\\nginx\\php\\ but it was using c:\\wamp64\\php . 我期望它正在使用c:\\nginx\\php\\但它正在使用c:\\wamp64\\php

A person can check by typing into the CLI: which php . 一个人可以通过输入CLI来检查: which php That works on Windows and will show the used location. 在Windows上可以使用,并显示使用的位置。

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

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