Here's the quick guide how to compile pdo_firebird and run tests for the ubuntu:
1) setup firebird superclassic:
$ sudo apt-get install firebird2.5-superclassic firebird2.5-dev
firebird2.5-examples
superclassic is the server itself (if in doubt, read this: http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/qsg25-classic-or-super.html), dev package contains headers to
compile pdo stuff, examples contains example db, i used it to run
tests in it.
Set up credentials for the server (see the link lower).
Get employee.fdb as written here
http://www.firebirdsql.org/manual/ubusetup.html to a some known and
writable path by your user (which tests will be run on).
2) make sure to compile php with following flags, you'll need interbase too (some
tests in pdo_firebird/tests need it)
./configure --enable-pdo --with-pdo-firebird --with-interbase
make
3) Run tests with environment variables that can be found in
ext/pdo_firebird/tests/common.phpt, I ran it like this:
$ PDO_FIREBIRD_TEST_DSN='firebird:dbname=/var/lib/firebird/2.5/data/employee.fdb'
PDO_FIREBIRD_TEST_USER='SYSDBA' PDO_FIREBIRD_TEST_PASS='masterkey'
TEST_PHP_EXECUTABLE=auto php -n ./run-tests.php ext/pdo_firebird
You're done!
Fonctions Firebird/Interbase (PDO_FIREBIRD)
Introduction
Ce module est EXPERIMENTAL. Cela signifie que le comportement de ces fonctions, leurs noms et, concrètement, TOUT ce qui est documenté ici peut changer dans un futur proche, SANS PREAVIS ! Soyez-en conscient, et utilisez ce module à vos risques et périls.
Installation
Utilisez l'option de compilation --with-pdo-firebird[=DIR] pour installer l'extension PDO Firebird, où [=DIR] (optionnel) représente le chemin vers le dossier d'installation de base de Firebird.
$ ./configure --with-pdo-firebird
Constantes pré-définies
Les constantes ci-dessous sont
définies par ce pilote et seront seulement disponibles lorsque l'extension
aura été compilée dans PHP ou chargée dynamiquement du moteur d'exécution.
De plus, ces constantes spécifiques au pilote devraient être utilisées seulement
si vous utilisez ce pilote. En utilisant les attributs spécifiques à un pilote
avec un autre pilote pourrait causer un comportement inattendu.
PDO::getAttribute() pourrait être utilisé pour obtenir
l'attribut PDO_ATTR_DRIVER_NAME pour vérifier le
pilote, si votre code peut fonctionner sur des pilotes multiples.
Sommaire
- PDO_FIREBIRD DSN — Connexion aux bases de données Firebird et Interbase
If you have a database alias on the server "localhost" called "test.fdb", you can do:
$conn = new PDO("firebird:dbname=localhost:test.fdb",
'SYSDBA','letmein');
Note that as of the time of writing, the Firebird driver doesn't correctly throw an exception on connection error
http://bugs.php.net/bug.php?id=41522
After much trial and error i found out you should use the following to connect to a firebird database:
<?php
$db = new PDO ("firebird:dbname=localhost:C:\\path\\to\\database\\MyDatabase.FDB", "username", "password");
?>
NOTE: in the 1st part of the connection string there can be NO spaces else you will get NULL.
The string provided on this site does not work and will give no error only NULL.
if youre dsn syntax is wrong, see ritsaert's comment, there maybe no errormessage!
The connection string for a firebird PDO connection is different than described above. It is something like:
$DB = new PDO("firebird:dbname=T:\\Klimreg.GDB", "SYSDBA", "masterkey");
after dbname= the default connection string for Interbase and Firebird databases is used as presented to either gds32.dll or fbclient.dll.
