# Installation guide

> The package uses LdapRecord Core 4, not LdapRecord-Laravel. Core uses Illuminate Collections and Contracts without requiring the Laravel framework.

## Requirements

- PHP 8.3.25 or later on the 8.3 branch, or PHP 8.4.12 or later.
- The PHP LDAP extension, enabled in the runtime that serves the application and not only in the CLI.
- Composer.
- Yii 2.0.55 or a later 2.0 patch, or Yii 22.0.

The package uses LdapRecord Core 4, not LdapRecord-Laravel. Core uses Illuminate Collections and Contracts without
requiring the Laravel framework.

## Install from Composer

Yii 2.0 uses Bower asset packages, and Composer reads repositories only from the application's own `composer.json`. If
the application does not already configure a source for them, add Asset Packagist before installing:

```bash
composer config repositories.asset-packagist composer https://asset-packagist.org
```

Install the package from your application directory:

```bash
composer require yii2-extensions/ldap:^0.1
```

To use Yii 22 while it is a development branch, allow that version in the application root:

```bash
composer require yii2-extensions/ldap:^0.1 yiisoft/yii2:22.0.x-dev
```

## Install from a local checkout

To try unreleased changes, register a local checkout as a Composer path repository:

```bash
composer config repositories.ldap path /path/to/ldap
composer require yii2-extensions/ldap:dev-main
```

[Back to documentation](/docs/extensions/ldap/index.md#documentation)