Introduction
The #1 Native LibSQL Extension for PHP - Build by Handsome Person from 🇮🇩
LibSQL PHP Extension designed to seamlessly handle local, remote, and remote replica/embedded replica connections, offering versatility and efficiency for your application’s data management needs. With an intuitive interface and flexible configuration options, LibSQL empowers developers to effortlessly integrate database operations into your PHP projects.
LibSQL Extension
LibSQL Extension for PHP GitHub Repository
libSQL is an open source, open contribution fork of SQLite, created and maintained by Turso. We aim to evolve it to suit many more use cases than SQLite was originally designed for, and plan to use third-party OSS code wherever it makes sense.
libSQL is licensed under an Open Source License, and we adhere to a clear Code of Conduct.
Features
- Embedded replicas that allow you to have replicated database inside your app.
- libSQL server for remote SQLite access, similar to PostgreSQL or MySQL
- Supports Rust, JavaScript, Python, Go, PHP, and more.
Download
Download the latest build extension binary you can see at Release page. It’s available for:
- Linux
- Mac/Darwin
- Windows
Install using Composer
You can install the libSQL Extension just like using NVM (Node Version Manager). With the installer, you can:
- Select the PHP version
- PHP Thread-Safe/Non Thread-Safe build version
- stable (
tursodatabase/turso-client-php
) or unstable (pandanotabear/turso-client-php
)
and more—all using turso-php-installer
.
Read more details about turso-php-installer
Manual Installation
- 📦 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
Check on your console/terminal
Now, you can use LibSQL
class in your PHP code!
Usage
Remember, this is not a library or ORM, this is the native extension for LibSQL.
That’s it! It’s feel like SQLite but it will more powerful 🚀