Unable to locate driver (Pdoexception "could not find driver")

Asked

Viewed 23,894 times

1

I’m trying to make a connection to my FIREBIRD database, but when I organize it right, I put the IP where it is located etc. The message appears:

COULDN’T LOCATE DRIVER ON c/wamp/www////

What should I do, people ?

 $user = "SYSDBA";
$pass = "masterkey";

$pdo=new PDO("firebird:localhost=IP AQUI;dbname=Duosig_producao",$user,$pass);
  • Driver is enabled in phpinfo()?

2 answers

3

Check if you are with enabled drive you can do so:

foreach(PDO::getAvailableDrivers() as $driver) {
  echo $driver;
}

If there is no drive enable in your php.ini the following extensions:

extension=php_interbase.dll
extension=php_firebird.dll

Restart apache and make sure the drive is active.

Another thing, you need to specify the path of your example database:

$str_conn = "firebird:dbname=C:\db\banco.gdb;host=localhost";

$dbh = new PDO($str_conn, "SYSDBA", "masterkey");

links: PDO FIREBIRD , FIREBIRD CONNECTION

2

I was able to solve however the correct line to enable the PDO of Firebird in php.ini is

extension=php_pdo_firebird.dll

And not

extension=php_firebird.dll
  • @gmsantos In the previously edited version it looked like he was commenting on Mysticpower’s response

Browser other questions tagged

You are not signed in. Login or sign up in order to post.