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.