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: 2021-05-03 11:43 UTC
Votes:1
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 - 42 = ?
Subscribe to this entry?

 
 [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.
 [2021-05-03 11:43 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Package: PDO_SQLITE +Package: *General Issues -Assigned To: +Assigned To: cmb
 [2021-05-03 11:43 UTC] cmb@php.net
The sqlite2 driver is no longer supported for many years, so this
ticket is obsolete.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC