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.
LVL 2
laurin1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
emphamyCommented:
nice, i am going to keep this as future ref just in case :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.