Link to home
Start Free TrialLog in
Avatar of laurin1
laurin1Flag for United States of America

asked on

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.
Avatar of emphamy
emphamy

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.
Avatar of laurin1

ASKER

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.
what mode are you running in? ISAPI or CGI?

have you given the php.ini file read writes by IUSER?
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.
Avatar of laurin1

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of laurin1
laurin1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
nice, i am going to keep this as future ref just in case :)