PHP not connecting to firebird database (interbase)

I have a legacy system for support and production, this system works fine, but on my development machine, I cannot connect to the database. My OS is Ubuntu 14.04 with fresh install of firebird2.5-classic, php version is 5.5.9-1ubuntu4.5 and I also installed interbase driver.

When I run this code:

$host = 'localhost:/var/www/html/webcalc/base/dbwebcalc.gdb';

$dbh = ibase_connect($host, 'SYSDBA', 'masterkey');

var_dump($dbh);

      

I am getting this message:

Warning: ibase_connect(): Your user name and password are not defined. Ask your database administrator to set up a Firebird login**. in /var/www/html/testes/conn_firebird.php on line 5.

      

But when I try to connect from the command line, the connection is established. So I guess the problem must be with the driver ...

In my file the /etc/firebid/<version>/SYSDBA.password

password matches, so I think the config is correct.

+3


source to share


2 answers


Try to autoload

sudo apt-get autoremove firebird2.5-classic

      

and install;



sudo apt-get install firebird2.5-classic

      

and also try changing the gsec utility;

gsec -database localhost:/var/lib/firebird/2.5/system/security.fdb
GSEC> modify SYSDBA -pw masterke

      

+1


source


Edit php.ini

:

; Default database name for ibase_connect().

ibase.default_db = 127.0.0.1:E:\path_to_bd\bd.fdb  ;(or whatever the path to bd is..mabe a port is needed: 127.0.0.1/3050:E:\path_to_bd\bd.fdb)

; Default username for ibase_connect().

ibase.default_user = "username"

; Default password for ibase_connect().

ibase.default_password = "yourpassword"

      



Ugly solution, but it works.

+1


source







All Articles