简体   繁体   中英

Using the wrong php.ini file

I have installed php 5.6.0 locally on Windows 8.1 and IIS 8.5.9600.16384.

The php.ini file that I want it to use is in c:\\php

My PHPRC environment variable is set to 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

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

phpinfo gives me:

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

I have restarted IIS

My "path" environment variable contains C:\\Program Files (x86)\\PHP\\v5.6;

I have added 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 ?

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. Now I have more control, a better understanding and a working php 5.6.

I had Wampserver installed and then switched to nginx, so Wampserver was still holding php. I was expecting it to be using c:\\nginx\\php\\ but it was using c:\\wamp64\\php .

A person can check by typing into the CLI: which php . That works on Windows and will show the used location.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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