infinity
infinity

Reputation: 115

Want to connect PHP5 to MS SQL SERVER 2005 in linux

I want to connect mssql server using php code on linux operating system. i want to use mssql_connect() .please help me. my code is

$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!";
}

it show error "Unable to connect to server: x.x.x.x\SQLEXPRESS"

Upvotes: 1

Views: 1734

Answers (1)

For me, this worked under debian lenny:

apt-get install libsybdb5 freetds-common php5-sybase
/etc/init.d/apache2 restart

I found the solution here: http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP

Upvotes: 1

Related Questions