Version 1 of the PHP SDK is installed with the Composer package manager. It requires PHP 8.2 or later and the curl extension.
Install the SDK
Run the following command in your project to install the latest stable release.
composer require surrealdb/surrealdb.php:^1.0Import the SDK
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.
Next steps
Connecting to SurrealDB to open a connection
Getting started to run your first queries