Graham
Graham

Reputation: 8141

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

Upvotes: 1

Views: 2214

Answers (2)

agm1984
agm1984

Reputation: 17132

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.

Upvotes: 0

Graham
Graham

Reputation: 8141

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

Upvotes: 2

Related Questions