Warning: mssql_connect () [function. mssql-connect]: Unableto

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.