mssql_connect(): unable to connect to server:

I have a PHP script that I run locally (on my Windows XP Machine) that accesses a MSSQL server using the mssql_connect() function. I used xampp to get PHP on my machine.

Today I finished getting this to work on my second computer. The first time I did this, I also ran into a million problem – but didn’t note any of them. So here I am rectifying my previous mistakes in the hope of not having to search for the same solution next time.

The error I was getting was:

mssql_connect(): unable to connect to server: ‘’

(Domain changed for security purposes.)

I handled it by replacing ntwdblib.dll with this in these two folders:


-Ashton Sanders
(Note: was the final website that helped me handle my problem.)