App Platform PHP Buildpack

PHP

heroku-buildpack-php is utilized as the buildpack for detecting and building your PHP applications.

You can view the README for a full list of configuration options available to the buildpack.

Detection

A PHP app is detected based on the existence of one of the following files at the root of your source code:

composer.json
index.php

Customization

PHP Version

  • PHP versions 7.x and 8.x are supported. PHP 7.x will be used by default, unless a specific version is requested via composer.json by your app or a dependency. To configure the version used for your app, add a php dependency to composer.json like so:
{
  "require": {
    "php": "^8.0.0"
  }
}

Limitations

  • Composer versions 1.x and 2.x are supported. App Platform will determine the version to use based on the the version of Composer that generated the composer.lock file. Generally, you can update your project by running composer update --lock using Composer 2.