|  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
 [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: Wed Feb 08 11:03:42 2023 UTC