简体   繁体   English

通过php远程连接到Mssql 2008服务器

[英]Connect to Mssql 2008 sever remotely through php

Quick question: I am having issues while trying to connect to a mssql 2008 server through php. 快速问题:尝试通过php连接到mssql 2008服务器时遇到问题。 The php script is located on a different server. php脚本位于其他服务器上。 Does the mssql server have to have php installed on it? mssql服务器必须在上面安装php吗? or only the server which I am running the script from? 还是仅是我从中运行脚本的服务器?

Only the server you are running PHP on. 仅在运行PHP的服务器上。 If there's a connection error, you may be having issues with you connection string or with the raw networking (for instance, the port you are trying to connect to is blocked on the remote server). 如果存在连接错误,则可能是连接字符串或原始网络出现问题(例如,您尝试连接的端口在远程服务器上被阻止)。

If you take a look at the documentation for mssql in PHP, you can see that it accepts both local and external addresses (computer or server, port). 如果查看PHP中mssql的文档 ,则可以看到它同时接受本地和外部地址(计算机或服务器,端口)。

The server running mssql, to which you're connecting, doesn't need PHP enabled. 您要连接到的运行mssql的服务器不需要启用PHP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM