mssql dll refuses to work

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
webafrica
Forum Newbie
Posts: 4
Joined: Thu Mar 23, 2006 6:44 am

mssql dll refuses to work

Post by webafrica »

Hi Guys,

Really need some guidance here from php gurus - we have exhausted all possibilities.

Just installed php 4.4.2 and php 5.1.2 on a new server and neither will work with mssql dll, however the dll is correctly loaded:
mssql
MSSQL Support enabled
Active Persistent Links 0
Active Links 0
Library version 7.0

When I run test scripts eg: $db = mssql_connect("sql.domain.com","dbuser","dbpass") or die("Unable to connect to server");

It simply returns "Unable to connect to server".

The database details are definitely correct, and the server is able to reach the mssql server.

Can anyone offer any advice?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

If you're getting that error the dll is fine ;)

Sounds more like a network/password issue.

Firewall? Remote access rights? ;)
webafrica
Forum Newbie
Posts: 4
Joined: Thu Mar 23, 2006 6:44 am

Post by webafrica »

I know - its bizarre, the dll appears to be loaded fine, its just not working "properly".

I can telnet to the sql server no problem from the web server (even tried turning off the firewall to make 100% sure). And tried different user/pass's numerous times, with no luck...

Isnt there perhaps some php debugging function that could assist me here? Otherwise I think its maybe time to break out packetyzer...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

webafrica wrote:Isnt there perhaps some php debugging function that could assist me here? Otherwise I think its maybe time to break out packetyzer...
Just setting error reporting to E_ALL and display_errors to On.

Code: Select all

error_reporting(E_ALL);
ini_set('display_errors', 'On');
You might also want to look at debug_backtrace() for general debugging but I'm not sure it'll be of much use here.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Code: Select all

$db = mssql_connect("sql.domain.com","dbuser","dbpass") or echo msql_error();
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

msql != mssql agtlewis ;)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Ack I'm missing an s...

Maybe mssql_get_last_message(); will work. Leave it to Microsoft to not return errors.
webafrica
Forum Newbie
Posts: 4
Joined: Thu Mar 23, 2006 6:44 am

Post by webafrica »

Ok, Im stumped.

mssql_get_last_message(); just outputs "cannot connect to server", however in ethereal no packets are being sent whatsoever :roll: ?

The process php-cgi.exe isnt being blocked on a process level because php_mysql.dll is cool - can connect no problem to mysql databases and the packets are being sent accordingly.

We tried turning off firewalls and made sure there are no files that can't be accessed using Filemon, but everything is fine.

I even installed port tunnel and setup so "localhost" routes to the sql server, but nothing - mssql_get_last_message(); just outputs "cannot connect to localhost". It is definitely working because we can telnet to localhost on 1433.

My only conclusion is either php_mssql.dll is;
a) being blocked from network access (unlikely as I have checked the server thoroughly)
b) buggy (again unlikely though as I have tried different versions)

I am pulling out hair here - any idea's?
webafrica
Forum Newbie
Posts: 4
Joined: Thu Mar 23, 2006 6:44 am

Post by webafrica »

Just had a premanition - could be malware/spyware....
Post Reply