PHPackages                             fbett/le\_acme2 - 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. fbett/le\_acme2

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

fbett/le\_acme2
===============

Letsencrypt PHP ACME v2 client

1.8.4(1y ago)324.3k↑128.6%13MITPHPPHP &gt;=8.2CI failing

Since Feb 26Pushed 1y ago4 watchersCompare

[ Source](https://github.com/fbett/le-acme2-php)[ Packagist](https://packagist.org/packages/fbett/le_acme2)[ Docs](https://github.com/fbett/le-acme2-php)[ RSS](/packages/fbett-le-acme2/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (36)Used By (0)

le-acme2-php [![CircleCI](https://camo.githubusercontent.com/2c94e6db91dba488fedb75b34e82c78c45e89b22c86d270e5bdd6a9dcec33bad/68747470733a2f2f636972636c6563692e636f6d2f67682f66626574742f6c652d61636d65322d7068702f747265652f6d61737465722e7376673f7374796c653d737667)](https://app.circleci.com/pipelines/github/fbett/le-acme2-php?branch=master)
====================================================================================================================================================================================================================================================================================================================================================

[](#le-acme2-php-)

[![Scrutinizer Build Status](https://camo.githubusercontent.com/a02620ae5761b01c79086a5143c570fed9d91749513b00316af0431f805cddcb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66626574742f6c652d61636d65322d7068702f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fbett/le-acme2-php/build-status/master)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/e47b894892ec853597aa6112fe99546dbca8c464973b4a05b0ac6cddff4c2835/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66626574742f6c652d61636d65322d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fbett/le-acme2-php/)[![Latest Stable Version](https://camo.githubusercontent.com/e6763e6cd49a03a91e78ad8a90faa60e2ea5cd57295ec740414f8a0b6ebb8462/687474703a2f2f706f7365722e707567782e6f72672f66626574742f6c655f61636d65322f76)](https://packagist.org/packages/fbett/le_acme2)[![License](https://camo.githubusercontent.com/6a2101a5110a363a2c6892f822d63079017e2a1a585c121276a9d233f1a322dc/687474703a2f2f706f7365722e707567782e6f72672f66626574742f6c655f61636d65322f6c6963656e7365)](https://packagist.org/packages/fbett/le_acme2)[![PHP Version Require](https://camo.githubusercontent.com/67d150980a8b5a6d2b4afdf9b5cc199d0f7593ce3a8af23fd5f663494df54413/687474703a2f2f706f7365722e707567782e6f72672f66626574742f6c655f61636d65322f726571756972652f706870)](https://packagist.org/packages/fbett/le_acme2)

LetsEncrypt client library for ACME v2 written in PHP.

This library is inspired by [yourivw/LEClient](https://github.com/yourivw/LEClient), completely rewritten and enhanced with some new features:

- Support for Composer autoload (including separated Namespaces)
- Automatic renewal process
- Managed HTTP authentication process
- Response caching mechanism
- Prevents blocking while waiting for server results
- Optional set a preferred chain

The aim of this client is to make an easy-to-use and integrated solution to create a LetsEncrypt-issued SSL/TLS certificate with PHP.

You have the possibility to use the HTTP authentication: You need to be able to redirect specific requests (see below)

You have also the possibility to use DNS authentication: You need to be able to set dynamic DNS configurations.

Wildcard certificates can only be requested by using the dns authentication.

Current version
---------------

[](#current-version)

Tested with LetsEncrypt staging and production servers.

Prerequisites
-------------

[](#prerequisites)

The minimum required PHP version is 8.2.

This client also depends on cURL and OpenSSL.

Getting Started
---------------

[](#getting-started)

Install via composer:

```
composer require fbett/le_acme2

```

Also have a look at the [LetsEncrypt documentation](https://letsencrypt.org/docs/) for more information and documentation on LetsEncrypt and ACME.

Example Integration
-------------------

[](#example-integration)

- Create a working directory. Warning: This directory will also include private keys, so i suggest to place this directory somewhere not in the root document path of the web server. Additionally this directory should be protected to be read from other web server users.

```
mkdir /etc/ssl/le-storage/
chown root:root /etc/ssl/le-storage
chmod 0600 /etc/ssl/le-storage

```

- (HTTP authorization only) Create a directory for the acme challenges. It must be reachable by http/https.

```
mkdir /var/www/acme-challenges

```

- (HTTP authorization only) Redirect specific requests to your acme-challenges directory

Example apache virtual host configuration:

```

        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule \.well-known/acme-challenge/(.*)$ https://your-domain.com/path/to/acme-challenges/$1 [R=302,L]

```

- (DNS authorization only) Set the DNS configuration

If `DNSWriter::write(...)` is called, set the DNS configuration like described in:

(By adding the digest as a TXT record for the subdomain '\_acme-challenge'.)

- Use the certificate bundle, if the certificate is issued:

```
if($order->isCertificateBundleAvailable()) {

    $bundle = $order->getCertificateBundle();

    $pathToPrivateKey = $bundle->path . $bundle->private;
    $pathToCertificate = $bundle->path . $bundle->certificate;
    $pathToIntermediate = $bundle->path . $bundle->intermediate;

    $order->enableAutoRenewal(); // If the date of expiration is closer than thirty days, the order will automatically start the renewal process.
}

```

If a certificate is renewed, the path will also change.

My integrated workflow is the following:

- User enables SSL to a specific domain in my control panel
- The cronjob of this control panel will detect these changes and tries to create or get an order like in the sample.
- The cronjob will fetch the information within the certificate bundle, if the certificate bundle is ready (mostly on the second run for challenge type HTTP and on the third run for challenge type DNS)
- The cronjob will also build the Apache virtual host files and will restart the Apache2 service, if the new config file is different.

Please take a look on the Samples for a full sample workflow.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.9% 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 ~75 days

Recently: every ~280 days

Total

34

Last Release

568d ago

PHP version history (5 changes)1.0.5PHP &gt;=7.1.0

1.0.6PHP &gt;=5.6.0

1.1.7PHP &gt;=7.1

1.4.1PHP &gt;=7.3

1.8.2PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24937658?v=4)[fbett](/maintainers/fbett)[@fbett](https://github.com/fbett)

---

Top Contributors

[![fbett](https://avatars.githubusercontent.com/u/24937658?v=4)](https://github.com/fbett "fbett (188 commits)")[![vokeit-gschuster](https://avatars.githubusercontent.com/u/56930714?v=4)](https://github.com/vokeit-gschuster "vokeit-gschuster (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fbett-le-acme2/health.svg)

```
[![Health](https://phpackages.com/badges/fbett-le-acme2/health.svg)](https://phpackages.com/packages/fbett-le-acme2)
```

###  Alternatives

[willvincent/laravel-rateable

Allows multiple models to be rated with a fivestar like system.

415468.6k3](/packages/willvincent-laravel-rateable)[appwrite/php-runtimes

Appwrite repository for Cloud Function runtimes that contains the configurations and tests for all of the Appwrite runtime environments.

49245.2k3](/packages/appwrite-php-runtimes)[sulu/automation-bundle

The Sulu Bundle which provides automation functionality

18301.8k10](/packages/sulu-automation-bundle)

PHPackages © 2026

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