|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57041 Silent death when using sqlite2: DSN with relative path
Submitted: 2006-05-25 15:55 UTC Modified: 2021-05-03 11:43 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: hans at velum dot net Assigned: cmb (profile)
Status: Not a bug Package: *General Issues
PHP Version: 5.1.0 OS: Linux
Private report: No CVE-ID: None
 [2006-05-25 15:55 UTC] hans at velum dot net
I'm not sure if this is the correct forum for this bug, as it's a bug when using sqlite2 DSN (PHP 5.1.4).

The problem is that the call to new PDO(...) returns NULL when the DSN specifies a relative path and no error is issued.  (I realize that the instructions say to use an absolute path, but since this is not necessary with the sqlite lib in PHP, this silent death is bound to cause perplexion for users.)

Reproduce code:
$pdo = new PDO("sqlite2:./my.db");

Expected result:
PHP Fatal error:  Uncaught exception 'PDOException' with message 'could not connect to database ....'

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-12 10:38 UTC] tellme dot 3 dot n1 at dfgh dot net
The problem is not limited to relative paths. If "./my.db" is non-readable, the same behavior occurs, even if the full path is specified.
 [2021-05-03 11:43 UTC]
-Status: Open +Status: Not a bug -Package: PDO_SQLITE +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2021-05-03 11:43 UTC]
The sqlite2 driver is no longer supported for many years, so this
ticket is obsolete.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 31 04:03:39 2023 UTC