Q: How can I solve this problem? (PHP connection MSSQL problems)

Source: Internet
Author: User
Tags mssql server
Q: How to connect to MSSQL in PHP: 1. install MYSQL in centos 5.9, 2. MSSSQL & nbsp; 2005 & nbsp; + WIN7, WIN7 & nbsp; The ntwdblib version is also 2005 & nbsp. Please help me (the problem of PHP connection to MSSQL)
Environment:
1. install MYSQL in centos 5.9,
2. MSSSQL 2005 + WIN7, with ntwdblib and 2005 installed on WIN7.

Problem:
I use PHP to connect to MSSQL. if the connection is local
$ Res = mssql_connect ('127. 0.0.1 ', 'sa', '123 ');
Var_dump ($ res );
?>
If I use the same configuration from another computer, the firewall will be shut down. The related service is also enabled. it is true that the connection fails. Share:
------ Solution --------------------
Reference:
Is MSSSQL 2005 installed on other computers?
RE: No

What is the php version? 5.3

Does the sa account allow remote access in mssql?
RE: Yes

Is your PHP and mssql running on one machine? If not, is mssql extension installed on the machine running php? Is the IP address changed to the IP address of the mssql server?
------ Solution --------------------
1. if not on the same machine, servername should be the target machine name or ip address +/instance name
2. php 5.3 has no mssql extension
3. by default, MSSSQL 2005 does not allow remote access.

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.