Before installing Turso Client PHP, ensure you have the following:
- PHP ≥ 8.1 (supports 8.1, 8.2, 8.3, 8.4)
- Composer (for installer package)
- Rust nightly toolchain (if building from source)
- Git
- Docker & Docker Compose (optional, for containerized development)
Supported platforms:
- ✅ Linux
- ✅ macOS
- ✅ Windows / WSL
There are multiple ways to install the extension depending on your environment and workflow.
The easiest way is via the official installer package:
composer global require darkterminal/turso-php-installerAdd the Composer global bin directory to your PATH:
export COMPOSER_BIN_DIR=$(composer config --global home)/vendor/bin
export PATH="$COMPOSER_BIN_DIR:$PATH"Run the installer:
turso-php-installer installThis will guide you step-by-step.
turso-php-installer install -n --php-version=8.3You can specify PHP versions (8.1, 8.2, 8.3, 8.4).
If you prefer to build directly:
# Clone the repository
git clone https://github.com/tursodatabase/turso-client-php.git
cd turso-client-php
# Ensure Rust nightly is available
rustup toolchain install nightly
rustup default nightly
# Build the extension
cargo buildThe compiled extension (.so / .dll) will be placed in target/.
You can also run inside a Docker container:
make compose/upFor Apple Silicon / ARM64 machines:
make compose-arm64/upFor available commands:
make helpAfter installation, enable the extension in your php.ini:
extension=libsql_php.soVerify the extension is loaded:
php -m | grep libsql- 👉 Quick Start — run your first queries with Turso Client PHP
- 👉 Connections — learn how to connect locally, in-memory, or to remote databases