Page 1 of 1
PHP + MSSQL problems...
Posted: Tue Apr 20, 2004 11:32 am
by dbarney
Okay.
Im using Windows2k3 Web Edition for hosting IIS6.0
Im using Windows2k3 Server for hosting a SQL2000 Database
Both work great except the fact that i can not get PHP to connect to the SQL Database.
I can get into the database using Access and a program called MSDE i think. It worked fine on the webserver.
PHP was working previously very well with SQL2000, but I restarted the servers, and it just stopped working.
Does anyone have any suggestions?
I have the dll's located properly, the extension is in the extensions directory. Im using SQL Authetication... Im really lost here..
Thanks!
Posted: Tue Apr 20, 2004 12:35 pm
by lostboy
Does php work at all? if you run phpinfo(), do you get the data?
Posted: Tue Apr 20, 2004 12:37 pm
by dbarney
Yes it does.
Works with phpinfo() and a few other self-made scripts
This is a SQL only-problem....
Again, i can connect in from the server using 3rd party PROGRAMS though....
Posted: Tue Apr 20, 2004 12:46 pm
by magicrobotmonkey
you have to use ODBC to connect ot mssql, right?
Posted: Tue Apr 20, 2004 1:07 pm
by dbarney
Nope. They have an extension for it which can be setup from the php.ini (if you used binary).
Posted: Tue Apr 20, 2004 2:14 pm
by dbarney
Time to confuse things up a bit more....
Ok, to install MSSQL drivers for PHP you have to get the ntwdblib.dll from the PHP Install, and move it to the c:\windows\system32... Or atleast thats what i had read. I try that, and i get a cannot connect error. BUT if i use the ntwdblib.dll from the SQL install, i get:
Warning: mssql_connect(): message: Login failed for user 'su'. (severity 14) in E:\wwwroot\flmanage.com\db.php on line 5
Posted: Tue Apr 20, 2004 2:16 pm
by magicrobotmonkey
well then that means that its working and you are just using the wrong username to log in, right?
Posted: Tue Apr 20, 2004 2:50 pm
by lostboy
should not the user be sa as the default user? Try a default user to ensure you can talk to the server before you try adding a more limited user...
PS it might not be the password, but the where the user is connecting from
Posted: Tue Apr 20, 2004 3:13 pm
by dbarney
Well, sa is the default login. And thats what im using.
And, again, using 3rd party software, on the same local ip network, i can connect using sa perfectly fine.
Posted: Tue Apr 20, 2004 3:53 pm
by lostboy
Warning: mssql_connect(): message: Login failed for user 'su'. (severity 14) in E:\wwwroot\flmanage.com\db.php on line 5
Your error shows
SU as the user, not
sa
Posted: Tue Apr 20, 2004 4:11 pm
by dbarney
Ok, i have figured out the problem
It was based on two different things.
A. Do not use the php ntwdblib.dll
B. Use the SQL version of ntwdblib.dll
C. Use the proper "sa" not "su"
I had done soo many variations of dll's and logins, i accidentally
typed su. easily overlooked after spending 6 hours doing this
Thanks alot