Page 1 of 1
MSSQL with PHP on IIS6
Posted: Tue Apr 18, 2006 12:23 pm
by nawhaley
I got PHP installed and configured on my webserver using the PHP5ISAPI.dll and ran a test page which seemed to run fine. The issue is when I start to run anything that does an SQL query it won't pull anything from the database. I also cant find a way to get error messages out of IIS leaving me with no way to debug it at all which is very frustrating. I have the system DSN file setup properly since testing it works,PHP also works since my test page pulling phpinfo() works as well.
All that comes up on my page that pulls data from the database is the initial text and once it reaches the query nothing else. This has me dumbfounded since I setup the whole thing on my local machine to test on apache then converted it over to work with IIS that worked fine before the web server crashed and I had to reinstall now nothing. Anyone have any ideas or at least a way to get error messages out of IIS6 so I can troubleshoot more effectively?
Posted: Tue Apr 18, 2006 1:54 pm
by feyd
Sounds like extensions or other DLL's needed couldn't be located or weren't loaded to begin with. Open up your php.ini, change error_reporting to E_ALL (at minimum), display_errors to On, and maybe even set the error_log entry to a full path (with file name)
Posted: Tue Apr 18, 2006 2:13 pm
by RobertGonzalez
Which version of MySQL are you trying to connect to? Did you enable your mysql or mysqli extensions?
Posted: Tue Apr 18, 2006 2:17 pm
by nawhaley
not using MySQL I'm using MS SQL server 2000. I'll work on setting up the error reporting and see what comes up on the screen. It almost looks like its just timing the query out when its running rather than failing since commonly when it fails I get a "fetch row invalid" message from my own error checking but thats not happening on this its just blank.
Posted: Tue Apr 18, 2006 2:55 pm
by nawhaley
Interestingly enough it looks like its denying access to the database for some reason between the two. Keep in mind my SQL server is not on the same box as the PHP app I"m running which is on my webserver. Here is the error message I am getting.
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server does not exist or access denied., SQL state 08001 in SQLConnect in D:\InetPub\wwwroot\test\appllivewritequestion.php on line 13
oddly this is happening with the System DSN configured properly I.E. its the same one I configured on my own PC for testing.
Posted: Tue Apr 18, 2006 3:40 pm
by RobertGonzalez
Sorry, I must have completely overlooked your post title (I'm losing it I think).
What db functions are you using?
Posted: Tue Apr 18, 2006 3:54 pm
by nawhaley
odbc functions I.E. odbc_connect() and the like. Like I stated it worked previously just after reinstalling the server some small component is missing keeping it from working now.
Posted: Tue Apr 18, 2006 3:58 pm
by RobertGonzalez
Cool, now I am back in the same timing as the rest of this thread

Is your set up exactly the same as it was prior to the reinstallation? Also, can you access your SQL Server with Enterprise Manager (or other DB utility)?
Posted: Wed Apr 19, 2006 7:36 am
by nawhaley
As far as I can tell the setups the same yes and yes I can access the database from the enterprise manager on the local server. Also my desk PC can access the database with the apache server setup I configured for testing its just the copy of the program configured for the IIS server that dosent seem to want to work properly. There has to be something different with the server configuration but I just can't put my finger on it as to what it could be.
P.S. Sorry for the overnight delay I went home and tried to forget about this stuff for a while >_>.
Posted: Thu Apr 27, 2006 11:37 am
by nawhaley
I"m going to bump this because I'm still scouring for an answer and I cant seem to find anything surely I"m not the "only" person to ever run into this does anyone have any ideas?