PHPackages                             heroku/heroku-buildpack-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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. heroku/heroku-buildpack-php

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

heroku/heroku-buildpack-php
===========================

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

v292(3w ago)8141.4M↓18.5%1.6k[41 issues](https://github.com/heroku/heroku-buildpack-php/issues)[3 PRs](https://github.com/heroku/heroku-buildpack-php/pulls)10MITShellCI passing

Since Apr 29Pushed 2d ago121 watchersCompare

[ Source](https://github.com/heroku/heroku-buildpack-php)[ Packagist](https://packagist.org/packages/heroku/heroku-buildpack-php)[ Docs](https://github.com/heroku/heroku-buildpack-php)[ RSS](/packages/heroku-heroku-buildpack-php/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)DependenciesVersions (302)Used By (10)

Heroku buildpack: PHP [![CI](https://github.com/heroku/heroku-buildpack-php/actions/workflows/ci.yml/badge.svg)](https://github.com/heroku/heroku-buildpack-php/actions/workflows/ci.yml)
=========================================================================================================================================================================================

[](#heroku-buildpack-php-)

[![php](https://raw.githubusercontent.com/heroku/buildpacks/refs/heads/main/assets/images/buildpack-banner-php.png)](https://raw.githubusercontent.com/heroku/buildpacks/refs/heads/main/assets/images/buildpack-banner-php.png)

This is the official [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) for PHP applications.

It uses Composer for dependency management, supports all recent versions of PHP as runtimes, and offers a choice of Apache2 or Nginx web servers.

Usage
-----

[](#usage)

You'll need to use at least an empty `composer.json` in your application.

```
$ echo '{}' > composer.json
$ git add composer.json
$ git commit -m "add composer.json for PHP app detection"

```

If you also have files from other frameworks or languages that could trigger another buildpack to detect your application as one of its own, e.g. a `package.json` which might cause your code to be detected as a Node.js application even if it is a PHP application, then you need to manually set your application to use this buildpack:

```
$ heroku buildpacks:set heroku/php

```

This will use the officially published version. To use the default branch from GitHub instead:

```
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-php

```

Please refer to [Dev Center](https://devcenter.heroku.com/categories/php) for further usage instructions.

Custom Platform Repositories
----------------------------

[](#custom-platform-repositories)

The buildpack uses Composer repositories to resolve platform (`php`, `ext-something`, ...) dependencies.

To use a custom Composer repository with additional or different platform packages, add the URL to its `packages.json` to the `HEROKU_PHP_PLATFORM_REPOSITORIES` config var:

```
$ heroku config:set HEROKU_PHP_PLATFORM_REPOSITORIES="https://.s3..amazonaws.com/heroku-24-amd64/packages.json"

```

To allow the use of multiple custom repositories, the config var may hold a list of multiple repository URLs, separated by a space character, in ascending order of precedence (meaning the last repository listed is handled first by Composer for package lookups).

**Please note that Heroku cannot provide support for issues related to custom platform repositories and packages.**

### Disabling the Default Repository

[](#disabling-the-default-repository)

If the first entry in the list is "`-`" instead of a URL, the default platform repository is disabled entirely. This can be useful when testing development repositories, or to forcefully prevent the use of any packages from the default platform repository.

### Repository Priorities

[](#repository-priorities)

It is possible to control [Composer Repository Priorities](https://getcomposer.org/doc/articles/repository-priorities.md) for custom platform repositories: whether Composer should

- treat a given repository as canonical;
- exclude specific packages from a repository;
- only allow specific packages from a repository.

These repository options (`canonical`, `exclude` and `only`) are controlled using the following query strings in the repository URL:

- `composer-repository-canonical` (`true` or `false`; defaults to `true`)
- `composer-repository-exclude` (comma-separated list of excluded package names)
- `composer-repository-only` (comma-separated list of allowed package names)

For example, the following config var will allow only packages `ext-igbinary` and `ext-redis` from `customrepo.com`; all other packages are looked up in the default repository:

```
$ heroku config:set HEROKU_PHP_PLATFORM_REPOSITORIES="https://customrepo.com/packages.json?composer-repository-only=ext-igbinary,ext-redis"

```

### Building Custom Repositories

[](#building-custom-repositories)

For instructions on how to build custom platform packages (and a repository to hold them), please refer to the instructions [further below](#custom-platform-packages-and-repositories).

Development
-----------

[](#development)

The following information only applies if you're forking and hacking on this buildpack for your own purposes.

### Custom Platform Packages and Repositories

[](#custom-platform-packages-and-repositories)

Please refer to the [README in `support/build/`](support/build/README.md) for instructions.

###  Health Score

76

—

ExcellentBetter than 100% of packages

Maintenance96

Actively maintained with recent releases

Popularity67

Solid adoption and visibility

Community48

Growing community involvement

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 91.6% 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 ~16 days

Recently: every ~7 days

Total

277

Last Release

24d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27900?v=4)[David Zuelke](/maintainers/dzuelke)[@dzuelke](https://github.com/dzuelke)

---

Top Contributors

[![dzuelke](https://avatars.githubusercontent.com/u/27900?v=4)](https://github.com/dzuelke "dzuelke (3023 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (92 commits)")[![edmorley](https://avatars.githubusercontent.com/u/501702?v=4)](https://github.com/edmorley "edmorley (54 commits)")[![heroku-linguist[bot]](https://avatars.githubusercontent.com/in/345499?v=4)](https://github.com/heroku-linguist[bot] "heroku-linguist[bot] (48 commits)")[![schneems](https://avatars.githubusercontent.com/u/59744?v=4)](https://github.com/schneems "schneems (11 commits)")[![tmaher](https://avatars.githubusercontent.com/u/297632?v=4)](https://github.com/tmaher "tmaher (11 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (9 commits)")[![ryanbrainard](https://avatars.githubusercontent.com/u/966764?v=4)](https://github.com/ryanbrainard "ryanbrainard (8 commits)")[![technomancy](https://avatars.githubusercontent.com/u/141?v=4)](https://github.com/technomancy "technomancy (6 commits)")[![runesoerensen](https://avatars.githubusercontent.com/u/16988?v=4)](https://github.com/runesoerensen "runesoerensen (5 commits)")[![fdr](https://avatars.githubusercontent.com/u/7191?v=4)](https://github.com/fdr "fdr (4 commits)")[![colincasey](https://avatars.githubusercontent.com/u/19131?v=4)](https://github.com/colincasey "colincasey (4 commits)")[![mattgraham](https://avatars.githubusercontent.com/u/51578?v=4)](https://github.com/mattgraham "mattgraham (3 commits)")[![tt](https://avatars.githubusercontent.com/u/19824?v=4)](https://github.com/tt "tt (2 commits)")[![lillianzhang331](https://avatars.githubusercontent.com/u/47681745?v=4)](https://github.com/lillianzhang331 "lillianzhang331 (2 commits)")[![Malax](https://avatars.githubusercontent.com/u/177877?v=4)](https://github.com/Malax "Malax (2 commits)")[![md-5](https://avatars.githubusercontent.com/u/1007849?v=4)](https://github.com/md-5 "md-5 (1 commits)")[![mdz](https://avatars.githubusercontent.com/u/436911?v=4)](https://github.com/mdz "mdz (1 commits)")[![mmcgrana](https://avatars.githubusercontent.com/u/2432?v=4)](https://github.com/mmcgrana "mmcgrana (1 commits)")[![pablotemporini](https://avatars.githubusercontent.com/u/65350172?v=4)](https://github.com/pablotemporini "pablotemporini (1 commits)")

---

Tags

buildpackherokuheroku-languagesphpphpnginxherokuapacheapache2foreman

### Embed Badge

![Health badge](/badges/heroku-heroku-buildpack-php/health.svg)

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

###  Alternatives

[corley/maintenance-bundle

Corley Maintenance Bundle

22233.9k](/packages/corley-maintenance-bundle)[renoki-co/laravel-healthchecks

Laravel Healthchecks is a simple controller class that helps you build your own healthchecks endpoint without issues.

5755.0k](/packages/renoki-co-laravel-healthchecks)

PHPackages © 2026

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