I have installed php-mssql package in Centos 6 for MSSql connection. I want to connect remote MSSql server from PHP 5.3.3.
My code:
$link = mssql_connect("192.168.*.*", 'username', 'password') or die ("Could not connect to database: ".mssql_get_last_message());
if (!$link) {
die('Something went wrong while connecting to MSSQL');
}
But I am getting below error,
Warning: mssql_connect(): Unable to connect to server: 192.168.*.* in /var/www/html/test.php on line 22
If I use through freetds
, it is working.
tsql -S192.168.*.* -Uusername -Ppassword
Please help me.