Using the wrong php.ini file

1

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
php
windows
iis
asked on Stack Overflow Mar 11, 2015 by Graham • edited Mar 11, 2015 by Graham

2 Answers

2

I uninstalled php and installed it manually instead. Now I have more control, a better understanding and a working php 5.6.

answered on Stack Overflow Apr 1, 2015 by Graham
0

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.

answered on Stack Overflow Jun 4, 2018 by agm1984

User contributions licensed under CC BY-SA 3.0