• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 761
  • Last Modified:

PHP on IIS - PHP Not Loading Correct php.in File

I've built many PHP servers and I can't figure out what I'm doing wrong with this new one. I've got two very similar servers, the only difference is the old one is a Domain Controller. Both are Windows 2003 Service Pack 2, with IIS 6, running PHP 5 (new one is 5.25, old one is 5.23, which I can't imagine is the issue.)

The new server will not see my php.ini file, unless it is in the c:\Windows directory. When it's in the c:\PHP directory, the file is not loaded (ignored.) PHP starts with no .ini file at all.

This is a very standard, default configuration. I've just recently built this server.
0
laurin1
Asked:
laurin1
  • 4
  • 3
1 Solution
 
emphamyCommented:
you have to have had php.ini on the c:\windows directory on the other server, php reads there for the php.ini i am not sure that it any longer looks under its own directory unless you run in cgi mode, i am guessing you are running isapi.

what is the problem of having php.ini in c:\windows? its better there than the default php install dir.
0
 
laurin1Author Commented:
No, it's not better to have it there. PHP recommends you put in in the PHP directory, which is where I have it on the other server and it works just fine. C:\PHP is in the path, so it doens't have to specifically look in c:\PHP, it just looks in the path.
0
 
emphamyCommented:
what mode are you running in? ISAPI or CGI?

have you given the php.ini file read writes by IUSER?
0
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

 
emphamyCommented:
fyi...

Basically it seems that the ISAPI module will look in the path set in PHPRC first, and choose the php-isapi.ini file. The CGI module will look in PHPRC first too, but it upon seeing no php.ini it will then move on to search it's own directory, where it finds php.ini.
0
 
laurin1Author Commented:
ISAPI, and yea, i've tried giving IUSR read perms and doen't help, plus on the working server, IUSR hasn't been given those rights and it works fine.
0
 
laurin1Author Commented:
The problem was the PHPRC variable. I added that (PHPRC=c:\PHP) and it works great.
0
 
emphamyCommented:
nice, i am going to keep this as future ref just in case :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now