PHPackages                             binwiederhier/etcd-php - 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. [API Development](/categories/api)
4. /
5. binwiederhier/etcd-php

ActiveLibrary[API Development](/categories/api)

binwiederhier/etcd-php
======================

Etcd client library for PHP

v2.0.2(9y ago)012.4k1MITPHPPHP &gt;=5.5.0

Since Feb 11Pushed 9y ago1 watchersCompare

[ Source](https://github.com/binwiederhier/etcd-php)[ Packagist](https://packagist.org/packages/binwiederhier/etcd-php)[ Docs](http://www.github.com/linkorb/etcd-php)[ RSS](/packages/binwiederhier-etcd-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (11)Used By (0)

[![Build Status](https://camo.githubusercontent.com/9e2339a38da4f19a9805f380cddb0aa368ba3ba9d72e7db5500cff5ff7d6c444/68747470733a2f2f7472617669732d63692e6f72672f6c696e6b6f72622f657463642d7068702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/linkorb/etcd-php)[![Latest Stable Version](https://camo.githubusercontent.com/b3f92847e1f9f887be1e14b8872edb6024846e817f4b075ac07595123a5cee21/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b6f72622f657463642d7068702f762f737461626c652e706e67)](https://packagist.org/packages/linkorb/etcd-php)[![Total Downloads](https://camo.githubusercontent.com/b57f6cd7228c4368898fe8cc7dc1843042a7d5bcaaf40ec82b9d28fa8bfc36d9/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b6f72622f657463642d7068702f646f776e6c6f6164732e706e67)](https://packagist.org/packages/linkorb/etcd-php)[![Latest Unstable Version](https://camo.githubusercontent.com/3dcc69dd0d51e3d5b96488d5e3a3effef03b5062ffb6cb800338bc47bd1425f3/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b6f72622f657463642d7068702f762f756e737461626c652e706e67)](https://packagist.org/packages/linkorb/etcd-php)[![License](https://camo.githubusercontent.com/fef10ab3b0387065da4d14b2cace1744fb9ea5e2b6a3a70e2bfb3c233bd827dc/68747470733a2f2f706f7365722e707567782e6f72672f6c696e6b6f72622f657463642d7068702f6c6963656e73652e706e67)](https://packagist.org/packages/linkorb/etcd-php)

Etcd client library for PHP
===========================

[](#etcd-client-library-for-php)

etcd is a distributed configuration system, part of the coreos project.

This repository provides a client library for etcd for PHP applications.

Installing and running etcd
---------------------------

[](#installing-and-running-etcd)

```
git clone https://github.com/coreos/etcd.git
cd etcd
./build
./bin/etcd
```

Brought to you by the LinkORB Engineering team
----------------------------------------------

[](#brought-to-you-by-the-linkorb-engineering-team)

Check out our other projects at [linkorb.com/engineering](http://www.linkorb.com/engineering).

Btw, we're hiring!

Usage
-----

[](#usage)

### The client

[](#the-client)

```
    $client = new Client($server);
    $client->set('/foo', 'fooValue');
    // Set the ttl
    $client->set('/foo', 'fooValue', 10);
    // get key value
    echo $client->get('/foo');

    // Update value with key
    $client->update('/foo', 'newFooValue');

    // Delete key
    $client->rm('/foo');

    // Create a directory
    $client->mkdir('/fooDir');
    // Remove dir
    $client->rmdir('/fooDir');

```

### The command line tool

[](#the-command-line-tool)

#### Setting Key Values

[](#setting-key-values)

Set a value on the `/foo/bar` key:

```
$ bin/etcd-php etcd:set /foo/bar "Hello world"
```

Set a value on the `/foo/bar` key with a value that expires in 60 seconds:

```
$ bin/etcd-php etcd:set /foo/bar "Hello world" --ttl=60
```

Create a new key `/foo/bar`, only if the key did not previously exist:

```
$ bin/etcd-php etcd:mk /foo/new_bar "Hello world"
```

Create a new dir `/fooDir`, only if the key did not previously exist:

```
$ bin/etcd-php etcd:mkdir /fooDir
```

Update an existing key `/foo/bar`, only if the key already existed:

```
$ bin/etcd-php etcd:update /foo/bar "Hola mundo"
```

Create or update a directory called `/mydir`:

```
$ bin/etcd-php etcd:setDir /mydir
```

#### Retrieving a key value

[](#retrieving-a-key-value)

Get the current value for a single key in the local etcd node:

```
$ bin/etcd-php etcd:get /foo/bar
```

#### Listing a directory

[](#listing-a-directory)

Explore the keyspace using the `ls` command

```
$ bin/etcd-php etcd:ls
/akey
/adir
$ bin/etcd-php etcd:ls /adir
/adir/key1
/adir/key2
```

Add `-recursive` to recursively list subdirectories encountered.

```
$ bin/etcd-php etcd:ls --recursive
/foo
/foo/bar
/foo/new_bar
/fooDir
```

### Deleting a key

[](#deleting-a-key)

Delete a key:

```
$ bin/etcd-php etcd:rm /foo/bar
```

Delete an empty directory or a key-value pair

```
$ bin/etcd-php etcd:rmdir /path/to/dir
```

Recursively delete a key and all child keys:

```
$ bin/etcd-php etcd:rmdir /path/to/dir --recursive
```

#### Watching for changes

[](#watching-for-changes)

Watch for only the next change on a key:

```
$ bin/etcd-php etcd:watch /foo/bar
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 54.3% 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 ~88 days

Recently: every ~43 days

Total

7

Last Release

3623d ago

Major Versions

v1.2.1 → v2.0.02016-07-23

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v2.0.0PHP &gt;=5.5.0

### Community

Maintainers

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

---

Top Contributors

[![congpeijun](https://avatars.githubusercontent.com/u/881552?v=4)](https://github.com/congpeijun "congpeijun (25 commits)")[![joostfaassen](https://avatars.githubusercontent.com/u/411113?v=4)](https://github.com/joostfaassen "joostfaassen (16 commits)")[![LeeSaferite](https://avatars.githubusercontent.com/u/47386?v=4)](https://github.com/LeeSaferite "LeeSaferite (2 commits)")[![gfyrag](https://avatars.githubusercontent.com/u/9094799?v=4)](https://github.com/gfyrag "gfyrag (1 commits)")[![pataquets](https://avatars.githubusercontent.com/u/1286254?v=4)](https://github.com/pataquets "pataquets (1 commits)")[![sammarks](https://avatars.githubusercontent.com/u/424093?v=4)](https://github.com/sammarks "sammarks (1 commits)")

---

Tags

phpapiconfigurationdistributedetcd

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/binwiederhier-etcd-php/health.svg)

```
[![Health](https://phpackages.com/badges/binwiederhier-etcd-php/health.svg)](https://phpackages.com/packages/binwiederhier-etcd-php)
```

###  Alternatives

[linkorb/etcd-php

Etcd client library for PHP

237144.3k1](/packages/linkorb-etcd-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k6](/packages/theodo-group-llphant)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[resend/resend-php

Resend PHP library.

596.2M35](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.5M10](/packages/checkout-checkout-sdk-php)[clicksend/clicksend-php

301.6M11](/packages/clicksend-clicksend-php)

PHPackages © 2026

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