{"record":{"id":"a2bc9371ddd11361","repo":"flarum/framework","slug":"sqlite-version-version-too-low-you-need-at-least-sqlite","errorCode":null,"errorMessage":"SQLite version ($version) too low. You need at least SQLite . DatabaseRequirements::SQLITE_MINIMUM","messagePattern":"SQLite version \\(\\$version\\) too low\\. You need at least SQLite \\. DatabaseRequirements::SQLITE_MINIMUM","errorType":"exception","errorClass":"RangeException","httpStatus":null,"severity":"error","filePath":"framework/core/src/Install/Steps/ConnectToDatabase.php","lineNumber":138,"sourceCode":"                $config['database'],\n                $config['prefix'],\n                $config\n            )\n        );\n    }\n\n    private function sqlite(array $config): void\n    {\n        if (! file_exists($config['database'])) {\n            $config['database'] = $this->basePath.'/'.$config['database'];\n        }\n\n        $pdo = (new SQLiteConnector())->connect($config);\n\n        $version = $pdo->query('SELECT sqlite_version()')->fetchColumn();\n\n        if (version_compare($version, DatabaseRequirements::SQLITE_MINIMUM, '<')) {\n            throw new RangeException(\"SQLite version ($version) too low. You need at least SQLite \".DatabaseRequirements::SQLITE_MINIMUM);\n        }\n\n        ($this->store)(\n            new SQLiteConnection(\n                $pdo,\n                $config['database'],\n                $config['prefix'],\n                $config\n            )\n        );\n    }\n}\n","sourceCodeStart":120,"sourceCodeEnd":151,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Install/Steps/ConnectToDatabase.php#L120-L151","documentation":"The SQLite install step reads SELECT sqlite_version() and throws a RangeException when the runtime SQLite library version is below DatabaseRequirements::SQLITE_MINIMUM. PHP bundles or links against a system SQLite library, so the check reflects libsqlite3, not the PHP version. The literal error text shows the constant concatenated after the message, and the detected version is interpolated first.","triggerScenarios":"Running the installer with driver `sqlite` when the SQLite library compiled into PHP (phpinfo pdo_sqlite) is older than SQLITE_MINIMUM — e.g. ancient bundled libsqlite in old PHP builds.","commonSituations":"Static PHP binaries or minimal Docker images shipping old libsqlite3; legacy shared hosting with an outdated PHP/SQLite stack; compiling PHP with a very old system sqlite3.","solutions":["Upgrade PHP to a recent version (bundled SQLite is modern) or link PHP against a newer libsqlite3","Recompile PHP's pdo_sqlite/sqlite3 extensions against an up-to-date libsqlite3-dev","Switch the install to MySQL/MariaDB/PostgreSQL instead of SQLite","Verify the effective version with `php -r \"echo (new PDO('sqlite::memory:'))->query('SELECT sqlite_version()')->fetchColumn();\"`"],"exampleFix":"// before\nDockerfile: FROM php:7.3-cli-alpine // old bundled sqlite\n// after\nDockerfile: FROM php:8.3-cli-alpine","handlingStrategy":"validation","validationCode":"$v = (new PDO('sqlite::memory:'))->query('SELECT sqlite_version()')->fetchColumn();\nif (version_compare($v, '3.24', '<')) { /* abort / use another driver */ }","typeGuard":null,"tryCatchPattern":"try { $step->run($dbConfig); } catch (RangeException $e) { echo $e->getMessage(); exit(1); }","preventionTips":["Use recent official PHP images which bundle modern libsqlite","Check pdo_sqlite lib version in deployment docs/CI","Avoid SQLite on legacy shared hosting; use a server DB"],"tags":["database","sqlite","version-check","installation"],"backgroundTag":"value-out-of-range","analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}