php.net |  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: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: hans at velum dot net Assigned:
Status: Open Package: PDO_SQLITE (PECL)
PHP Version: 5.1.0 OS: Linux
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:
Package:
Bug Type:
Summary:
From: hans at velum dot net
New email:
PHP Version: OS:

 

 [2006-05-25 15:55 UTC] hans at velum dot net
Description:
------------
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:
--------------
NULL

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Jan 19 23:01:23 2020 UTC