Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php mssql_connect():无法连接到服务器(没有freetds.conf)_Php_Sql Server_Freetds - Fatal编程技术网

Php mssql_connect():无法连接到服务器(没有freetds.conf)

Php mssql_connect():无法连接到服务器(没有freetds.conf),php,sql-server,freetds,Php,Sql Server,Freetds,我有两台服务器:一台是OpenSUSE,另一台是SLES 11 sp2 Suse Linux企业服务器 为了连接到MSSQL,我必须为php安装MSSQL.so OpenSUSE允许从rpm安装mssql。 SLES-没有mssql rpm,这就是为什么需要编译它 OpenSUSE:mssql rpm已安装=> $server="172.x.x.x:49888"; $username="username"; $password="password"; $link = mssql_connect(

我有两台服务器:一台是OpenSUSE,另一台是SLES 11 sp2 Suse Linux企业服务器

为了连接到MSSQL,我必须为php安装MSSQL.so

OpenSUSE允许从rpm安装mssql。 SLES-没有mssql rpm,这就是为什么需要编译它

OpenSUSE:mssql rpm已安装=>

$server="172.x.x.x:49888";
$username="username";
$password="password";
$link = mssql_connect($server, $username, $password);
这里成功连接到MSSQL

SLES:使用mssql.so编译=>

$server="172.x.x.x:49888";
$username="username";
$password="password";
$link = mssql_connect($server, $username, $password);
错误:警告:mssql_connect():无法连接到服务器:172.x.x.x:49888

如果我编辑freetds.conf

#A typical Microsoft server
[Dovico]
    host = 172.x.x.x
    port = 49888
    tds version = 7.0
然后像这样更改php:

$server="Dovico";
$username="username";
$password="password";
$link = mssql_connect($server, $username, $password);
=>已成功连接到MSSQL

因此,我的问题是,如何在SLES上使用MSSQL连接(使用MSSQL.So编译),使用此

mssql_connect("172.x.x.x:49888", "username", "password");

不使用freetds.conf?

编辑
freetds.conf
(取消注释并更改版本):


然后重新启动Apache。

获取mssql的opensuse srpm,并在sles?Hi ihtus上编译它。如果有人删掉了与帖子无关的闲聊内容,请留下。谢谢
[global]
        # TDS protocol version
;   tds version = 4.2
[global]
        # TDS protocol version
    tds version = 7.0