# Installation

Install Surqlize with Composer, including the alpha v2 SurrealDB PHP SDK it depends on.

Surqlize is installed with [Composer](https://getcomposer.org/download/). It requires PHP `8.4` or later and depends on the alpha [v2 SurrealDB PHP SDK](/docs/reference/php/v2.md).

## Install the package

```bash
composer require surrealdb/surqlize
```

Surqlize depends on the alpha SDK, so your project must allow alpha releases. If Composer cannot resolve the SDK under the default `stable` minimum stability, lower the stability for the SDK or set it project-wide.

```bash
composer config minimum-stability alpha
composer config prefer-stable true
```

## Add an HTTP client

Surqlize runs queries through the SDK, which uses [PSR-18](https://www.php-fig.org/psr/psr-18/) and [PSR-17](https://www.php-fig.org/psr/psr-17/) interfaces for the HTTP transport. Install a client and factory implementation, plus discovery, when you connect over `http://` or `https://`.

```bash
composer require guzzlehttp/guzzle php-http/discovery
```

The WebSocket transport uses PHP's native stream functions and needs no extra packages. See the [SDK installation guide](/docs/reference/php/v2/installation.md) for details.

## Requirements

| Requirement | Version |
|-------------|---------|
| PHP | `>= 8.4` |
| SurrealDB PHP SDK | `surrealdb/surrealdb.php` (v2 alpha) |
| SurrealDB server | `1.x` up to (but not including) `4.0.0` |

## Next steps

- [Models](/docs/reference/php/libraries/surqlize/models.md) - Describe your first table as a model.

- [Connections](/docs/reference/php/libraries/surqlize/connections.md) - Register the SDK executor Surqlize runs queries through.
