
Prerequisites
Before you start, make sure you:- Install the Turso CLI
- Sign up or login to Turso
- Have an PHP Application with Doctrine DBAL
- Linux
- Mac/Darwin
- Windows (WSL) / Devcontainer
Turso PHP Installer (Linux/macOS only)
Turso PHP Installer (Linux/macOS only)
Get the installer:Add as a global executable script:UsageInstall Turso Client PHP / libSQL Extension:Check on your console/terminalUpdate Turso Client PHP / libSQL Extension:Uninstall Turso Client PHP / libSQL Extension:
Manual Configuration
Manual Configuration
- 📦 Extract the archive
- 🗃 Locate somewhere in your machine
- 💽 Copy a relative path that address that extension/driver
- 📂 Open
php.ini
search;extension
if you using nano (ctrl+w) then searching for it - 📝 add in the next-line
extension=liblibsql_php.so
(in Linux) without;
at the begining
LibSQL
class is available in your PHP environment! You can use it everywhere in your PHP project 🎉
1
Configure database credentials
Get the database URL:Get the database authentication token:Assign credentials to the environment variables inside
.env
.Save this later when you need to connect to Remote and Embedded Replica
2
Create PHP Project
Create new directory:
3
Install Turso Doctrine DBAL
4
Configure database connection
Setup the environment variable in your Laravel application, choose what the type connection you need.Other environment variables (Embedded Replica Only)
5
Project Structure Example
6
Your PHP Application Ready!
