在从fedora连接的时候安装了php7.x,其中包含以下细节:
try {
$conn = new PDO("sqlsrv:Server=$dbHosts;Database=$bNames", $dbUsers, $dbPasss);
//Error for this ....ould not find driver
//$conn = new PDO("odbc:Driver={SQL Server};Server=$dbHosts;Database=$dbNames", $dbUsers, $dbPasss);
//Error for this....SQLSTATE[01000] SQLDriverConnect: 0 [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
} catch (PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
我用fedora安装了所有(odbc,mysql)
我可能错误地将具有相同连接类的相同应用程序错误地用于具有凭证的相同数据库在xampp中工作
问候