### Description The following code: ```php #!/usr/bin/env php <?php print "open_basedir: "; var_dump(ini_get("open_basedir")); print "\n"; $db = new \PDO("sqlite::memory:?cache=shared", null, null, [ \PDO::ATTR_PERSISTENT => true, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_EMULATE_PREPARES => false, \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC, ]); ``` Resulted in this output: ``` $ ./sqlite-nomemory.php open_basedir: string(0) "" PHP Fatal error: Uncaught PDOException: open_basedir prohibits opening :memory:?cache=shared in …\sqlite-nomemory.php:8 Stack trace: #0 …\sqlite-nomemory.php(8): PDO->__construct('sqlite::memo ry:...', NULL, Object(SensitiveParameterValue), Array) #1 {main} thrown in …\sqlite-nomemory.php on line 8 ``` But I expected this output instead: ``` I expected no error. Frankly, the code should just work. ``` ### PHP Version ```plain PHP 8.4.13 (cli) (built: Sep 23 2025 15:17:09) (ZTS Visual C++ 2022 x64) Copyright (c) The PHP Group Zend Engine v4.4.13, Copyright (c) Zend Technologies with Zend OPcache v8.4.13, Copyright (c), by Zend Technologies ``` ### Operating System Windows 10
Activity
AnrDaemon commentedon Oct 6, 2025
The https://bugs.php.net/bug.php?id=81742 is probably relevant.
ndossche commentedon Oct 6, 2025
These checks are inaccurate:
php-src/ext/sqlite3/sqlite3.c
Lines 126 to 127 in 3f81288
php-src/ext/pdo_sqlite/sqlite_driver.c
Line 810 in 3f81288
Fix phpGH-20076: open_basedir prohibits opening :memory:?cache=shared