本文介绍了“远程接口拒绝连接".通过PDO连接到Firebird 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试以下代码,但会导致异常- SQLSTATE [HY000] [335544421]连接被远程接口拒绝:
Try code below, but cause exception - SQLSTATE[HY000] [335544421] connection rejected by remote interface:
try {
$dbh = new PDO("firebird:dbname=localhost/3050:empty", "SYSDBA", "masterkey");
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sth = $dbh->query('SELECT idmspos, idmsqnt, cdmsval from svc$dms');
$sth->setFetchMode(PDO::FETCH_ASSOC);
while($row = $sth->fetch()) {
echo $row['idmspos']." ".$row['idmsqnt']." ".$row['cdmsval']."<br>";
}
$dbh = null;
}
catch(PDOException $e) {
$dbh = null;
echo $e->getMessage();
}
规格:
Linux 3.2.0-4-686-pae #1 SMP Debian 3.2.65-1+deb7u1 i686 GNU/Linux
PHP 5.6
php5-interbase
Firebird 3 from official site. Server is worked, can connect to him from local and remote machine.
推荐答案
查找firebird.conf
,取消注释(如果使用fbclient 2.x),并更改以下参数以禁用WireCrypt并为旧式身份验证设置更高的优先级:
Find firebird.conf
, uncomment (if using fbclient 2.x) and change the following parameters to disable WireCrypt and set higher priority for legacy authentication:
WireCrypt = Disabled
AuthServer = Legacy_Auth, Srp, Win_Sspi
AuthClient = Legacy_Auth, Srp, Win_Sspi
这篇关于“远程接口拒绝连接".通过PDO连接到Firebird 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!