Open source · MIT

The database client for PHP.

Native LibSQL bindings for PHP through a Rust extension compiled with ext-php-rs — open flags, fetch modes, prepared statements, transactions and offline writes.

 composer global require darkterminal/turso-php-installer
 turso-php-installer install --php-version=8.4

The features the day-to-day work needs

Open flags, fetch modes, prepared statements and transactions — wrapped in a PHP-shaped API around a native Rust engine.

Native engine

Rust extension via ext-php-rs. No userland PDO layer, no serialization overhead between PHP and the engine.

PHP-shaped API

Open flags, fetch modes, batch, prepared statements — the surface PHP developers already know.

Production sane

Panic-free error mapping, registries, cleanup on drop/finalize, deterministic ordering.

Cloud & offline

Remote, local, in-memory and embedded replica connections, plus offline writes that sync when connectivity returns.

Install in one command

Composer package plus the installer CLI.

shell
 composer global require darkterminal/turso-php-installer && turso-php-installer install --php-version=8.4

Before you run it

  • PHP 8.1 – 8.5 (nts / ts)
  • composer global bin dir on PATH
  • Rust nightly toolchain only when building from source

On first install

  • The installer compiles the Rust extension for your PHP version
  • The extension registers the LibSQL class on load
  • You are ready to open a database file
— Stars
— Contributors
v1.7.1 Latest release

Open source, on your infrastructure

The Rust client and the PHP bridge live in the same repository — the extension you install is the engine your code talks to.

Star on GitHub

Support the project

Maintenance and releases are funded by the community.