connect远程MSSQL服务器

connect远程MSSQL服务器

本文介绍了为什么我的服务器连接到使用PHP mssql_connect远程MSSQL服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不得不搬到我们写了一个客户端一个新的服务器,我是用PHP mssql_connect已停止工作启动远程连接的应用程序。我注意到,PHP不与MSSQL编译所以我要求服务器管理员进行安装。我可以验证它现在通过PHP安装的信息,但我现在从mssql_connect得到一个一致的无法连接到服务器的错误。

I've had to move an app we wrote for a client to a new server and a remote connection I was initiating with PHP mssql_connect has ceased to work. I noticed that PHP wasn't compiled with mssql so I asked the server admin to install it. I can verify that it's now installed via PHP info but I now get a consistent "Unable to connect to server" error from mssql_connect.

下面是我在运行非常简单的PHP脚本:

Here's the very simple PHP script I'm running:

$myServer = "myserver.com:5000";
$myUser = "myusername";
$myPass = "mypassword";

$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer. Error: " . mssql_get_last_message());

我已经证实,凭据仍然是正确的,但不管是什么原因,似乎mssql_connect只是没有做这件事。我不知道是否有一些管理员已经福尔戈做已经安装的扩展和freetds的。任何指针大大AP preciated! :)

I've confirmed that the credentials are still correct but for whatever reason it seems that mssql_connect just isn't doing it's thing. I'm wondering if there's something that the admin has forgotton to do having installed the extension and FreeTDS. Any pointers greatly appreciated! :)

问题解决了!

所有它竟然是在/usr/local/freetds/etc/freetds.conf指定的freetds的协议版本号后,行号13必须是注释。原来如此! :)

After all that it turned out to be the FreeTDS protocol version number as specified in /usr/local/freetds/etc/freetds.conf, line number 13 had to be uncommented. That was it! :)

推荐答案

毕竟,它竟然是freetds的协议版本号为/usr/local/freetds/etc/freetds.conf规定,行数13例是注​​释。原来如此! :)

After all that it turned out to be the FreeTDS protocol version number as specified in /usr/local/freetds/etc/freetds.conf, line number 13 had to be uncommented. That was it! :)

这篇关于为什么我的服务器连接到使用PHP mssql_connect远程MSSQL服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 23:21