10

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();
}

Specs:

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.
Mark Rotteveel
  • 82,132
  • 136
  • 114
  • 158
Vladimir Z.
  • 648
  • 3
  • 11
  • 29
  • 1
    Which `libfbclient.so` are you using? The one from Firebird 3, or the one from Firebird 2.5 or earlier? If you use the one from 2.5 or earlier, you need to configure Firebird 3 to accept insecure connections (although I believe that would give a different error than the one in your message). – Mark Rotteveel May 22 '15 at 10:36
  • @MarkRotteveel I just downloaded and installed the Firebird 3 server, and then install the package php5-interbase, a no additional action is taken. Currently did a search of all files `libfbclient.so` and replace them with a file from the server folder `/opt/firebird/lib`. The error is repeated. Where I can allow accept insecure connections? No found same param in `firebird.conf`. No other versions of firebird don't installed before. – Vladimir Z. May 22 '15 at 11:06
  • 2
    I believe it is the setting `WireCrypt` (which defaults to `Required`), set it to `Enabled` or `Disabled` instead. However if you are already using the libfbclient.so from Firebird 3, this isn't going to fix it. – Mark Rotteveel May 22 '15 at 11:37
  • 1
    @MarkRotteveel Found this string in `firebird.conf`. By default was commented. Uncomment and change to `WireCrypt = Disabled`, and uncomment and change `AuthServer = Legacy_Auth, Srp, Win_Sspi` and `AuthClient = Legacy_Auth, Srp, Win_Sspi`. Now works. Thx. – Vladimir Z. May 22 '15 at 12:28
  • 1
    Consider answering your own question with this information; it might help others as well! – Mark Rotteveel May 22 '15 at 12:47

3 Answers3

15

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
Mark Rotteveel
  • 82,132
  • 136
  • 114
  • 158
Vladimir Z.
  • 648
  • 3
  • 11
  • 29
  • 1
    This is just an workaround if you use fbclient 2.x. Make sure you link fbclient 3.x to PHP and it will work without any tweaks. – Marcodor Dec 03 '16 at 16:10
0

May be a bit late for the questioner but the "connection rejected by remote interface" might still be current topic as there was a change in the firebird api from debian 8 to 9/10.

The problem does also depend on which interbase/firebird-client-library to use. While in debian 8 one has libfbclient2 in Firebird API Version 2.5, starting from Debian 9 this libfbclient2 been upgraded to Firebird API 3.0. libFBclient ist the client-library to connect to Firebird / Interbase-Servers.

If, now, you have an old-versioned server, as we do, namely Interbase XE3 from year 2012, the new firebird-library in version 3.0 can not connect anymore to this old server type, while the previous library 2.5 can.

So one solution for us when migrating from Debian 8 to Debian 10 was to install the old version of libfbclient2 from debian 8 to the new Debian 10 system and then, afterwards, install the higher language clients, e.g. php7.3-interbase.

When installing the system in this manner, the php 7.3. interbase client shows no problems connecting the the old interbase server.

Here is a small instruction on how to install libfbclient2 (api version 2.5 from debian 8) to a new debian 9/10 system and to use it with php7.3:

First, uninstall all higher level language client packages, like php7.3-interbase and all firebird common/client/server-stuff.

Then download and first install via dpkg calls the old libfbclients from debian 8. They can be found hier: https://packages.debian.org/jessie/libfbclient2

However, this package depends on the 4 following packages:

multiarch-support
libc6
firebird2.5-common
firebird2.5-common-doc

While the first two ones are in suitable version already available in Debian 10 and could be installed right from there, the latter two need to be downloaded from the debian 8 jessie - archive and need to be installed first.

tombo_189
  • 352
  • 4
  • 20
-2

You need to change the Firebird service as follows:

  1. Install Firebird

  2. Go search Services-> Firebird

  3. Right click on Firebird->Properties-> LogOn-> and tick checkbox having option as "Allows services to interact with Desktop"

  4. and then click on Restart service

    You are now able to connect with firebird successfully in case of Firebird 2.1.

Community
  • 1
  • 1