Loquaz Mendes
Loquaz Mendes

Reputation: 31

PHP is not connecting with a firebird (interbase) database

I have a legacy system to maintain and in production this system runs ok, but in my development machine I can't connect to the database. My OS is a Ubuntu 14.04 with a fresh install of firebird2.5-classic, php version is 5.5.9-1ubuntu4.5 and i installed the interbase driver too.

When I run this code:

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

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

var_dump($dbh);

I receive this return 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 command line, the connection is established. So, I think the problem must be with the driver...

In my /etc/firebid/<version>/SYSDBA.password file the password matchs, so, I think the configuration is correct.

Upvotes: 3

Views: 2388

Answers (2)

Barsan Radu
Barsan Radu

Reputation: 11

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.

Upvotes: 1

Serkan KOCAMAN
Serkan KOCAMAN

Reputation: 115

Try to autoremove

sudo apt-get autoremove firebird2.5-classic

and install;

sudo apt-get install firebird2.5-classic

and also try to change in gsec utility;

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

Upvotes: 1

Related Questions