I have a Centos server with apache and PHP on it, and I have a SQL Server on another server, when I try to connect to MSSQL
with tsql -H
"sql server ip" -p1433 -U sa
, it works and connects OK, but when I try to run following PHP
code
error_reporting(E_ALL);
ini_set('display_errors', '1');
$connection = mssql_connect('serverIP', 'username', 'password');
I get the error :
Warning: mssql_connect(): Unable to connect to server: serverIP in /var/www/html/mssql.php on line 4
what should I do?