Q: How can I solve the problem of connecting MSSQL with PHP:
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.
Reply to discussion (solution)
Is MSSSQL 2005 installed on other computers?
What is the php version?
Does the sa account allow remote access in mssql?
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 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?
You can change it to an IP address.
Isn't mssql extension ntwdblib. dll? Or something else?
The server has a php Extension Library for enabling PHP.
Does the client still install any other MSSQL or PHP Extension Library?
I checked that PHP is 5.2.
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.
1. if not on the same machine, servername should be the target machine name or ip address +/instance name
RE: IP address used directly without multiple instances
2. php 5.3 has no mssql extension
RE: Just checked 2.96
3. by default, MSSSQL 2005 does not allow remote access.
Mssql2005 remote enabled, because the remote connection with MSSQL client can be successful
Mssql OS win2003 + R2
Output an error and see what the prompt is.