我想在linux操作系统上使用php代码连接mssql服务器。我想使用mssql_connect(),请帮助我。我的代码是
$server='x.x.x.x'SQLEXPRESS';
$link = mssql_connect($server, 'username', 'password');
if (!$link)
{
die("Couldn't connect to SQL Server on $server. Error: " . mssql_get_last_message());
}
else
{
echo "Connected!";
}
显示错误" cannot connect to server: x.x.x.x'SQLEXPRESS"
对于我来说,这在debian lenny下工作:
apt-get install libsybdb5 freetds-common php5-sybase
/etc/init.d/apache2 restart
我找到了解决方案:http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP