Firebird 3 with PHP

Created by: Administrator, Last modification: 18 Jan 2019 (17:21 UTC)

Having had problems getting Firebird 3 running in legacy mode with PHP in the past I'd been putting it off since Firebird 2.5 has been running fine, and I still have 1.5 running on a few legacy sites. However a cockup with updating a production machine has brought the ned to get it working to the top of the pile again. SUSE Leap 15.0 had replaced my working 2.5.6 install with 3.0.2 and while the quick fix was simply to drop the PHP sites to accessing a different machine for the database, establishing why the FB3 setup was not working needed investigating.

The starting point is the Firebird 3 Release Notes Compatibility Section and this only really has a couple of pages affecting the Linux setup I'm using.

First step was to copy list from aliases.conf is databases.conf as this the list of available databases running on the system. On the SUSE based configuration these files are found in /etc/firebird and aliases.conf.rpmsave had been left in place which was a help. What had also appeared here was a folder firebird.conf.d in which I've got 50-server.conf which correctly locks all the databases down to the /srv/firebird folder which is where I've always stored them, each in their own sub-folder along with any site specific database material. A cron job creates a nightly backup and retains the last 5 here. (need to update the notes on that)

The next step would be 'Initializing the Security Database' except the first note on that page is that this should not done if you only want to retain legacy mode. I had some problems here as it was not certain if the right things had been created. In order to check things out I needed to install firebird-examples package which I'd initially left off the machine. The other difference is that while "isql -user sysdba employee" should then work, on SUSE the conflict with the other isql programs is solved by making it isql-fb. So then "isql-fb -user sysdba employee" should work and "select SEC$USER_NAME, SEC$PLUGIN from SEC$USERS;" should list "SYSDBA Legacy_UserManager". The old generic password is in place, so it is prudent at this point to change this.

  SQL> alter user SYSDBA password 'SomethingCryptic';
  SQL> commit;
  SQL> quit;

But I think I ran this while the firebird server was stopped. On SUSE this is managed via "systemctl stop firebird" and it is somewhat confusing after working with firebird/interbase for over 20 years and finding you can access it while it's NOT running. SUSE had not actually started the service, so "systemctl start firebird" was necessary to fire that up. I also had to enable it in the Services Manager to start at boot time.


The next crib sheet on the compatibility list is for 'Legacy Authentication', which gives the settings required as

WireCrypt = Disabled
AuthServer = Legacy_Auth, Srp, WinSspi
AuthClient = Legacy_Auth, Srp, WinSspi
UserManager = Legacy_UserManager

but I found that this did not work for me.

WireCrypt = Disabled
AuthServer = Legacy_Auth
AuthClient = Legacy_Auth
UserManager = Legacy_UserManager

is working nicely and I can access the Firebird 3 machine via Flamerobin from the development machine which still has 2.5.6 on it and after rebooting the server I can access an FB3 restored site database from PHP7.2 on the same machine.

Need to do a little tidying up of these notes which I will cross check when I do a clean install of Firebird on the development machine.