Warning: mssql_connect () [function. mssql-connect]: Unabletoconnecttoserver. Next we will introduce the solution to this problem.
Warning: mssql_connect () [function. mssql-connect]: Unable to connect to server. Next we will introduce the solution to this problem.
I have one server, win2003SP1 + sqlserver2000 (with SP4 patch installed)
What is the remote connection failure of PHP to sql2000?
1. You can test the connection on the server!
2. query analyzer on your computer can also be connected!
Port 1433 on the server is listening
The sql2000 user name and password are correct, and the permission is fine!
Ntwdblib. dll versions are almost updated in the 2000.80.194.0, php, and system32 directories.
Both ntwdblib. dll and php_mssql.dll have been copied to the system32 directory.
The semicolon before extension = php_mssql.dll has been removed.
The server environment is wamp. After modification, it has been restarted!
I have tried many methods, but I still cannot connect them. The methods on the Internet have basically passed! There is no way! For help!
The following code and failure prompt are provided!
Code:
The Code is as follows: |
|
1. $ conn = mssql_connect ("121.10.108.112", 'm123', 'm123') or die ('cannot be connected '); 2. $ conn = mssql_connect ("121.10.108.112: 1433", 'm123', 'm123') or die (' '); 3. $ conn = mssql_connect ("121.10.108.112, 1433", 'm123', 'm123') or die ('database connection disconnection '); |
All three types of code have been tried.
Failure prompt:
Warning: mssql_connect () [. mssql-connect]: Unable to connect to server: 121.10.108.112 in C: wampwwwtest. php on line 9
Database connection failure
Solution
Unified is:
Win2003 + mssql2000 + php5.23
Implementation Method
Is there any ntwdblib. dll file in the php Directory? Ntwdblib. dll is the Client Connection Library. If you check the version number, it will usually be 7.0. This can only be connected to mssq 7.0, in order to be the same as the tutorial version of our current database, we can set ntwdblib under mssql. copy the dll to the directory where your php is located and replace the 7.0. Restart iis.