ID:               49730
 Comment by:       nicolas dot rod at gmail dot com
 Reported By:      marcink86 at interia dot eu
 Status:           Open
 Bug Type:         PDO related
 Operating System: Windows Vista
 PHP Version:      5.2.11
 New Comment:

I forgot to mention that sometimes in Windows you have to modify file
c:\windows\system32\drivers\etc\services.
You need to add the following line in order to connect to the GDS
services:

gds        3050/tcp            #Firebird Database port number

And that's it.
It took me 2 hours to read the error message and realize what the
problem was.


Previous Comments:
------------------------------------------------------------------------

[2010-02-04 18:14:03] nicolas dot rod at gmail dot com

The DSN in the test.php above is incorrect:

<?php
  $pdo = new PDO("firebird:host=localhost;dbname=TESTDB", "sysdba",
"masterkey");
  var_dump($pdo);
?>

it should be:

<?php
  $pdo = new PDO("firebird:dbname=localhost:TESTDB", "sysdba",
"masterkey");
  var_dump($pdo);
?>

------------------------------------------------------------------------

[2009-10-02 20:01:04] marcink86 at interia dot eu

Anyone to comfirm? Is it going to be fixed?

------------------------------------------------------------------------

[2009-10-01 11:10:25] marcink86 at interia dot eu

Note that in my case DSN is correct and NULL should not be returned in
CLI.

------------------------------------------------------------------------

[2009-10-01 11:03:46] [email protected]

See also Bug #49320 PDO returns null when SQLite connection fails

------------------------------------------------------------------------

[2009-10-01 06:22:16] marcink86 at interia dot eu

Description:
------------
I created a file test.php:

<?php
  $pdo = new PDO("firebird:host=localhost;dbname=TESTDB", "sysdba",
"masterkey");
  var_dump($pdo);
?>

Note that there exists an alias TESTDB to *FDB file in Firebird
configuration.

When I 'run' this file in a web browser i get:
object(PDO)#1 (0) { } 
which I think is correct since after var_dump($pdo) I can retrieve
records from this database without any problem.

However, in command line ("php test.php" in cmd) var_dump($pdo) returns
NULL. Is it correct?
It causes many problems espacially in a Symfony framework (>=1.2) where
you build sql files and execute them through command line.




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49730&edit=1

Reply via email to