flarum/framework · error · RangeException
SQLite version ($version) too low. You need at least SQLite…
Error message
SQLite version ($version) too low. You need at least SQLite . DatabaseRequirements::SQLITE_MINIMUM
What it means
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.
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();"`
Example fix
// before Dockerfile: FROM php:7.3-cli-alpine // old bundled sqlite // after Dockerfile: FROM php:8.3-cli-alpine
Defensive patterns
Strategy: validation
Validate before calling
$v = (new PDO('sqlite::memory:'))->query('SELECT sqlite_version()')->fetchColumn();
if (version_compare($v, '3.24', '<')) { /* abort / use another driver */ } Try / catch
try { $step->run($dbConfig); } catch (RangeException $e) { echo $e->getMessage(); exit(1); } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- MySQL version ($version) too low. You need at least MySQL
- PostgreSQL version ($version) too low. You need at least…
- Please specify a database driver.
- Currently, only MySQL, MariaDB, SQLite and PostgreSQL are…
- You must enter a valid email.
AI-assisted analysis of flarum/framework@4b939f6853 (2026-09-15).
Data as JSON: /api/errors/a2bc9371ddd11361.
Report an issue: GitHub.
Appendix: source
Thrown at framework/core/src/Install/Steps/ConnectToDatabase.php:138
$config['database'],
$config['prefix'],
$config
)
);
}
private function sqlite(array $config): void
{
if (! file_exists($config['database'])) {
$config['database'] = $this->basePath.'/'.$config['database'];
}
$pdo = (new SQLiteConnector())->connect($config);
$version = $pdo->query('SELECT sqlite_version()')->fetchColumn();
if (version_compare($version, DatabaseRequirements::SQLITE_MINIMUM, '<')) {
throw new RangeException("SQLite version ($version) too low. You need at least SQLite ".DatabaseRequirements::SQLITE_MINIMUM);
}
($this->store)(
new SQLiteConnection(
$pdo,
$config['database'],
$config['prefix'],
$config
)
);
}
}
View on GitHub (pinned to 4b939f6853)