1--TEST--
2PDO_sqlite: Testing URIs with open_basedir
3--EXTENSIONS--
4pdo_sqlite
5--INI--
6open_basedir="{TMP}"
7--FILE--
8<?php
9
10// create in basedir
11$filename = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'pdo_sqlite_filename.db';
12
13new PDO('sqlite:file:' . $filename);
14?>
15
16--CLEAN--
17<?php
18$filenames = [
19    sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'pdo_sqlite_filename.db',
20];
21foreach ($filenames as $filename) {
22    if (file_exists($filename)) {
23        unlink($filename);
24    }
25}
26?>
27--EXPECTF--
28Fatal error: Uncaught PDOException: open_basedir prohibits opening %s in %s:%d
29Stack trace:
30%s
31#1 {main}
32  thrown in %s
33