Search by

darkterminal / turso-php-installer

darkterminal

Turso libSQL Extension PHP Installer

Package info

github.com/darkterminal/turso-php-installer

pkg:composer/darkterminal/turso-php-installer

Fund package maintenance!

darkterminal

Statistics

Installs: 11 026

Dependents: 2

Suggesters: 0

Stars: 20

Open Issues: 0

2.2.3 2026-11-18 13:32 UTC

README

Shows a black logo in light color mode and a white one in dark color mode.

Turso PHP Installer

This is the Turso/libSQL Extension for PHP installer script for Linux and MacOS. Make sure you already have PHP minimal version 8.2.

Release assets of the extension currently cover PHP 8.1–8.5 (NTS and TS builds) — the installer always reads the latest release automatically.

Installation

composer global require darkterminal/turso-php-installer

Laravel Sail

Copy and Paste the stubs from here

make sure the installer is available in PATH environment variable:

export PATH="$HOME/.composer/vendor/bin:$PATH"
# or
export PATH="$HOME/.config/composer/vendor/bin:$PATH"

Usage & Overview

USAGE:  <command> [options] [arguments]

install                    Install Turso libSQL Extension for PHP
uninstall                  Uninstall Turso libSQL Extension for PHP
update                     Update Turso libSQL Extension for PHP
version                    Display Turso PHP Installer version

token:create               Create libSQL Server Database token for Local Development
token:delete               Delete a database token
token:list                 Display all generated database tokens
token:show                 Show libSQL Server Database token for Local Development

Unix Only Command

server:ca-cert-create      Generate CA certificate
server:ca-cert-delete      Delete a CA certificate from the global store location
server:ca-cert-list        List all generated CA certificates
server:ca-cert-show        Show raw CA certificate and private key
server:ca-peer-cert-create Create a peer certificate
server:cert-store-get      Get the cert store location
server:cert-store-set      Set/overwrite global certificate store, to use by the server later. Default is same as {installation_dir}/certs
server:check               Check server requirement, this will check if python3 pip and cryptography lib are installed

sqld:env-delete            Delete an environment by name or ID
sqld:env-edit              Edit an existing environment by ID or name
sqld:env-list              List all created environments
sqld:env-new               Create new sqld environment, save for future use.
sqld:env-show              Show detail of environment
sqld:open-db               Open database using Turso CLI based on environment id or name and database
sqld:server-run            Run sqld server based on environment id or name
sqld:daemon-list           List all running sqld daemons
sqld:daemon-kill           Kill a running sqld daemon

Install Extension

Interactive Mode

turso-php-installer install

Non Interactive Mode

PHP NTS (Non Thread-Safe) Build

By default the installer will install the stable version of libSQL Client from tursodatabase/turso-client-php release with NTS (Non Thread-Safe) build version.

turso-php-installer install -n --php-version=8.3 --php-ini=/etc/php/<version>/cli/php.ini --extension-dir=/path/to/your-custom/extensions/directory

But, if you want to use the unstable version (which is the development) version of libSQL Client, the installer will install from another source pandanotabear/turso-client-php release with NTS (Non Thread-Safe) build version. (Btw, Panda is my another pet in GitHub)

turso-php-installer install -n --unstable --php-version=8.3 --php-ini=/etc/php/<version>/cli/php.ini --extension-dir=/path/to/your-custom/extensions/directory

PHP TS (Thread-Safe) Build

Stable version build - libSQL Client from tursodatabase/turso-client-php release with TS (Thread-Safe) build version.

turso-php-installer install -n --thread-safe --php-version=8.3 --php-ini=/etc/php/<version>/cli/php.ini --extension-dir=/path/to/your-custom/extensions/directory

Unstable version build - libSQL Client, the installer will install from another source pandanotabear/turso-client-php release with TS (Thread-Safe) build version.

turso-php-installer install -n --unstable --thread-safe --php-version=8.3 --php-ini=/etc/php/<version>/cli/php.ini --extension-dir=/path/to/your-custom/extensions/directory

See turso-php-installer install --help

Uninstall Extension

turso-php-installer uninstall

Update Extension

turso-php-installer update

Using Local LibSQL for Development

Create Database Token

Create libSQL Server Database token for Local Development (an Ed25519-signed JWT pair for local sqld use)

turso-php-installer token:create <db-name>

Show Database Token

Show libSQL Server Database token for Local Development

turso-php-installer token:show <db-name>

This command will show all tokens and secrets of that database. You can also read individual secrets via turso-php-installer token:show <db-name> --fat | --roa | --pkp | --pkb

See detail explanation

FAQ

The Extension Is Not Working in Windows

Please, download the official release extension binary from Turso Client PHP GitHub Release Page. Or you can use WSL, or you can use Turso Docker PHP

Give Me a Coffee

  • GitHub Sponsors
  • Direct Paypal