Bug #57041 [Opn->Nab]: Silent death when using sqlite2: DSN with relative path

From: Date: Mon, 03 May 2021 11:43:43 +0000
Subject: Bug #57041 [Opn->Nab]: Silent death when using sqlite2: DSN with relative path
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233649@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=57041&edit=1 ID: 57041 Updated by: cmb@php.net Reported by: hans at velum dot net Summary: Silent death when using sqlite2: DSN with relative path -Status: Open +Status: Not a bug Type: Bug -Package: PDO_SQLITE +Package: *General Issues Operating System: Linux PHP Version: 5.1.0 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: The sqlite2 driver is no longer supported for many years, so this ticket is obsolete. Previous Comments: ------------------------------------------------------------------------ [2006-09-12 10:38:12] 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. ------------------------------------------------------------------------ [2006-05-25 15:55:54] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=57041&edit=1

« previous php.bugs (#233649) next »