PHPackages                             launchdarkly/server-sdk-consul - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. launchdarkly/server-sdk-consul

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

launchdarkly/server-sdk-consul
==============================

LaunchDarkly PHP SDK Consul integration

3.2.0(2y ago)09.7k↑29.3%1[1 PRs](https://github.com/launchdarkly/php-server-sdk-consul/pulls)Apache-2.0PHPPHP &gt;=7.4CI passing

Since Aug 7Pushed 1mo ago35 watchersCompare

[ Source](https://github.com/launchdarkly/php-server-sdk-consul)[ Packagist](https://packagist.org/packages/launchdarkly/server-sdk-consul)[ Docs](https://github.com/launchdarkly/php-server-sdk-consul)[ RSS](/packages/launchdarkly-server-sdk-consul/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (13)Used By (0)

LaunchDarkly Server-Side SDK for PHP - Consul integration
=========================================================

[](#launchdarkly-server-side-sdk-for-php---consul-integration)

[![Run CI](https://github.com/launchdarkly/php-server-sdk-consul/actions/workflows/ci.yml/badge.svg)](https://github.com/launchdarkly/php-server-sdk-consul/actions/workflows/ci.yml)[![Packagist](https://camo.githubusercontent.com/f73e1d0446a75c3abe5d1d4a793d92d972a5821cf7530cbf696b2e00b0d9d5c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61756e63686461726b6c792f7365727665722d73646b2d636f6e73756c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/launchdarkly/server-sdk-consul)[![Documentation](https://camo.githubusercontent.com/594b549773dcf2ae2c08cc82426986546623581e9e74bf421a89b823d9541bd2/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d4769744875622b5061676573266d6573736167653d4150492b7265666572656e636526636f6c6f723d303061646438)](https://launchdarkly.github.io/php-server-sdk-consul)

This library provides a [Consul](https://www.consul.io/)-backed data source for the [LaunchDarkly PHP SDK](https://github.com/launchdarkly/php-server-sdk), replacing the default behavior of querying the LaunchDarkly service endpoints. The underlying Consul client implementation is the [`friendsofphp/consul-php-sdk`](https://github.com/FriendsOfPHP/consul-php-sdk) package.

The minimum version of the LaunchDarkly PHP SDK for use with this library is 4.0.0. In earlier versions of the SDK, the Consul integration was bundled in the main SDK package.

This version of the package uses version 5.x of the `consul-php-sdk` client. If your application needs to use an earlier version of `consul-php-sdk`, use `launchdarkly/server-sdk-consul` 1.x (for version 2.x of `consul-php-sdk`) or `launchdarkly/server-sdk-consul` 2.x (for version 4.x of `consul-php-sdk`).

The minimum PHP version is 7.4.

For more information, see [our SDK documentation](https://docs.launchdarkly.com/sdk/features/storing-data).

Quick setup
-----------

[](#quick-setup)

This assumes that you have already installed the LaunchDarkly PHP SDK in your project.

1. Install this package with `composer`:

```
php composer.phar install launchdarkly/server-sdk-consul --save
```

If your project does not already have a dependency on `friendsofphp/consul-php-sdk`, that package will be loaded automatically as a dependency of `launchdarkly/server-sdk-consul`.

3. In your SDK configuration code, configure the Consul integration:

```
    $fr = LaunchDarkly\Integrations\Consul::featureRequester([
        "prefix" => "my-key-prefix"
    ]);
    $config = [ "feature_requester" => $fr ];
    $client = new LDClient("sdk_key", $config);
```

By default, the store will try to connect to a local Consul instance on port 8500. You may specify an alternate configuration as described in the API documentation for `Consul::featureRequester`. Make sure the `prefix` option corresponds to the key prefix that is being used by the Relay Proxy.

About LaunchDarkly
------------------

[](#about-launchdarkly)

- LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
    - Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
    - Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
    - Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
    - Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
- LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list.
- Explore LaunchDarkly
    - [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
    - [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
    - [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
    - [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance58

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 61% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~135 days

Recently: every ~124 days

Total

7

Last Release

936d ago

Major Versions

1.x-dev → 2.0.02022-06-15

2.x-dev → 3.0.02022-06-15

PHP version history (2 changes)1.0.0PHP &gt;=7.3

3.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7e78fd12fb89ed4e1494144fe649fb09b90f1aaa1bd34513b92190dddd73d6a?d=identicon)[launchdarkly](/maintainers/launchdarkly)

---

Top Contributors

[![eli-darkly](https://avatars.githubusercontent.com/u/35503443?v=4)](https://github.com/eli-darkly "eli-darkly (25 commits)")[![keelerm84](https://avatars.githubusercontent.com/u/1922716?v=4)](https://github.com/keelerm84 "keelerm84 (9 commits)")[![ld-repository-standards[bot]](https://avatars.githubusercontent.com/u/111005579?v=4)](https://github.com/ld-repository-standards[bot] "ld-repository-standards[bot] (3 commits)")[![kparkinson-ld](https://avatars.githubusercontent.com/u/93555788?v=4)](https://github.com/kparkinson-ld "kparkinson-ld (2 commits)")[![apache-hb](https://avatars.githubusercontent.com/u/35050275?v=4)](https://github.com/apache-hb "apache-hb (1 commits)")[![devin-ai-integration[bot]](https://avatars.githubusercontent.com/in/811515?v=4)](https://github.com/devin-ai-integration[bot] "devin-ai-integration[bot] (1 commits)")

---

Tags

consulfeature-flagsfeature-toggleslaunchdarklylaunchdarkly-sdklaunchdarkly-sdk-componentmanaged-by-terraformphplaunchdarklylaunchdarkly php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/launchdarkly-server-sdk-consul/health.svg)

```
[![Health](https://phpackages.com/badges/launchdarkly-server-sdk-consul/health.svg)](https://phpackages.com/packages/launchdarkly-server-sdk-consul)
```

###  Alternatives

[launchdarkly/server-sdk

Official LaunchDarkly SDK for PHP

3810.2M11](/packages/launchdarkly-server-sdk)[launchdarkly/launchdarkly-php

Official LaunchDarkly SDK for PHP

392.0M4](/packages/launchdarkly-launchdarkly-php)[worksome/feature-flags

A package to manage feature flags in your application

11506.3k](/packages/worksome-feature-flags)[ipe/smsir-php

A package for sending SMS.

1113.3k1](/packages/ipe-smsir-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
