• Start

Languages

/

PHP

/

v1 (stable)

Installation

Install version 1 of the SurrealDB PHP SDK with Composer.

Version 1 of the PHP SDK is installed with the Composer package manager. It requires PHP 8.2 or later and the curl extension.

Run the following command in your project to install the latest stable release.

composer require surrealdb/surrealdb.php:^1.0

Include the Composer autoloader, then import the Surreal class.

require __DIR__ . '/vendor/autoload.php';

use Surreal\Surreal;

You can now create a Surreal instance and connect to your database.

Was this page helpful?