CentOS7. I have installed
yum install freetds-bin
and
yum install php5-mssql
PDO drivers in phpinfo: dblib, mysql, sqlite
File with connection:
try {
$hostname = "xxx.xxx.xxx.xx";
$port = 1443;
$dbname = "MyName";
$username = "test";
$pw = "123456";
$dbh = new PDO ("dblib:host=$hostname:$port;dbname=$dbname","$username","$pw");
} catch (PDOException $e) {
echo "Failed to get DB handle: " . $e->getMessage() . "\n";
exit;
}
This page is very long running, and at the end shows error 500.
An error in the connection in this file? Or is the remote access to the SQL Server opened incorrectly on the MSSQL side? How to understand which side of the problem?