|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77886 using host in dsn string
Submitted: 2019-04-13 16:19 UTC Modified: 2019-04-14 16:04 UTC
From: ch dot derenne at gmail dot com Assigned:
Status: Not a bug Package: PDO Firebird
PHP Version: 7.3.4 OS: fedora28
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ch dot derenne at gmail dot com
New email:
PHP Version: OS:


 [2019-04-13 16:19 UTC] ch dot derenne at gmail dot com
From manual page:
In all documentation of PDO we see that host is the database host and path is the local database path relative to the host

But using this with firebird issues that database file is not found (of course, if host is not localhost)
In fact, searching in website, we see that we don't care about host, we have to use a database patch like hostname:databasepath

So why not using same syntaxe whatever firebird, mysql or other database ?
Or best : detecting if we ar eusing the host variable or not ?

We've spent one hour to find what was wrong

Test script:
	$db = new PDO($str_conn, $usn, $psw);
	catch(PDOException $e) 
		die ('ERREUR PDO dans ' . $e->getFile() . ' L.' . $e->getLine() . ' : ' . $e->getMessage());
echo "connexion ok"

Expected result:
connexion ok

Actual result:
PDO Error (file not found)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-04-13 16:45 UTC]
-Status: Open +Status: Not a bug
 [2019-04-13 16:45 UTC]
Details on the DSN for the Firebird PDO driver is available at
 [2019-04-14 16:04 UTC] ch dot derenne at gmail dot com
Why using two different syntax if the advantage of using pdo is to use one syntax whatever the SGBD is  ?

Or why not giving warning when we use host string in the dsn for firebird ?
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Feb 05 18:03:43 2023 UTC