Heroku PHP Support Reference
Last updated December 09, 2024
Table of Contents
Heroku supports PHP applications, including ones built with popular frameworks like Laravel and Symfony.
To learn how to deploy a sample PHP app, check out the Getting Started on Heroku with PHP tutorial. For a Laravel-specific tutorial, see Getting Started with Laravel on Heroku.
PHP Runtimes
Heroku allows you to run your application using the official PHP runtime. For more information on PHP runtimes, check out PHP Behavior in Heroku and Specifying a PHP Runtime.
Supported Versions
Heroku’s PHP support extends to applications using the latest available releases in the PHP 8.1, PHP 8.2, and PHP 8.3 series.
The support for PHP release series on the Heroku platform follows the PHP Group’s support policy. Typically, this support means active updates for two years after an initial x.y.0 version, followed by a year of security updates.
When a PHP release series reaches end-of-life, Heroku no longer supports it., Its latest release remains available for builds to allow customers to upgrade their applications to a newer PHP version.
PHP 8.1 is in security-only maintenance mode and will be fully end-of-life at the end of 2025. Only critical security fixes will be provided by the PHP maintainers for this release series. We encourage users to update their applications to PHP 8.3. For more information on support timelines for PHP releases, refer to the Supported Versions page on the official PHP website.
Available Versions
The following table lists the runtime versions that are available for builds on each stack.
PHP 7 and PHP 8.0 are end-of-life. The PHP maintainers provide no more bug fixes, including critical security fixes, for these version series. Heroku also doesn’t provide support for applications using these releases. We encourage users to update their applications to PHP 8.3. For more information on support timelines for PHP releases, refer to the Supported Versions page on the official PHP website.
Runtime / series | heroku-20 |
heroku-22 |
heroku-24 |
---|---|---|---|
PHP 7.3 | 7.3.33 | - | - |
PHP 7.4 | 7.4.33 | - | - |
PHP 8.0 | 8.0.30 | - | - |
PHP 8.1 | 8.1.31 | 8.1.31 | - |
PHP 8.2 | 8.2.26 | 8.2.26 | 8.2.26 |
PHP 8.3 | 8.3.14 | 8.3.14 | 8.3.14 |
Rows marked up with yellow text and background indicate a PHP release series that is only receiving security updates from the upstream maintainers. Rows marked up with red text and background indicate a PHP release series that is fully end-of-life and no longer receiving updates of any kind from the upstream maintainers and is no longer supported by Heroku.
Default Runtime
Applications that don’t use a composer.json
, or where composer.lock
contains no requirements for package php
even in any dependent package, picks the latest possible version of either PHP 7 or PHP 8 on the heroku-20
stack, and PHP 8 on all other stacks.
Available Built-In Extensions
The following built-in extensions that come bundled with PHP are available for the noted release series. A ✔ means the extension gets loaded by default, while an ✱ means that you must explicitly enable the extension via composer.json
.
Extension | PHP 7.3 | PHP 7.4 | PHP 8.0 | PHP 8.1 | PHP 8.2 | PHP 8.3 |
---|---|---|---|---|---|---|
ext-bcmath |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-bz2 |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-calendar |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-ctype |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-curl |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-date |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-dom |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-exif |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-fileinfo |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-filter |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-ftp |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-gd |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-gettext |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-gmp |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-hash |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-iconv |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-imap |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-intl |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-json |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-ldap |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-libxml |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-mbstring |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-mysqli |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-mysqlnd |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-openssl |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-pcntl |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-pcre |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-pdo |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-pdo_mysql |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-pdo_pgsql |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-pdo_sqlite |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-pgsql |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-phar |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-posix |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-random |
- | - | - | - | ✔ | ✔ |
ext-readline |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-reflection |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-session |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-shmop |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-simplexml |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-soap |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-sockets |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-sodium |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-spl |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-sqlite3 |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-tokenizer |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-xml |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-xmlreader |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-xmlrpc |
✔ | ✱ | - | - | - | - |
ext-xmlwriter |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-xsl |
✔ | ✱ | ✱ | ✱ | ✱ | ✱ |
ext-zend-opcache |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-zip |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ext-zlib |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
✔: enabled by default ✱: optional, can be enabled via composer.json |
Columns marked up with yellow text and background indicate a PHP release series that is only receiving security updates from the upstream maintainers. Columns marked up with red text and background indicate a PHP release series that is fully end-of-life and no longer receiving updates of any kind from the upstream maintainers and is no longer supported by Heroku.
Available Third-Party Extensions
The following table lists which third-party extensions are available for each release series of PHP. As these extensions are distributed independently of the PHP runtime, their versions are also listed. They’re never loaded by default and must be explicitly enabled via composer.json
.
The ext-blackfire
and ext-newrelic
extensions are currently not supported on the Fir generation of the Heroku platform.
Extension | PHP 7.3 | PHP 7.4 | PHP 8.0 | PHP 8.1 | PHP 8.2 | PHP 8.3 |
---|---|---|---|---|---|---|
ext-amqp (1.x) |
1.11.0 | 1.11.0 | 1.11.0 | 1.11.0 | 1.11.0[3] | - |
ext-amqp (2.x) |
- | - | 2.1.2 | 2.1.2 | 2.1.2 | 2.1.2 |
ext-apcu |
5.1.24 | 5.1.24 | 5.1.24 | 5.1.24 | 5.1.24 | 5.1.24 |
ext-blackfire |
1.92.28 | 1.92.28 | 1.92.28 | 1.92.28 | 1.92.28 | 1.92.28 |
ext-cassandra |
1.3.2 | - | - | - | - | - |
ext-ev |
1.1.5 | 1.1.5 | 1.2.0 | 1.2.0 | 1.2.0 | 1.2.0 |
ext-event (2.x) |
2.5.7 | 2.5.7 | - | - | - | - |
ext-event (3.x) |
3.1.4 | 3.1.4 | 3.1.4 | 3.1.4 | 3.1.4 | 3.1.4 |
ext-imagick |
3.7.0 | 3.7.0 | 3.7.0 | 3.7.0 | 3.7.0 | 3.7.0 |
ext-memcached |
3.3.0 | 3.3.0 | 3.3.0 | 3.3.0 | 3.3.0 | 3.3.0 |
ext-mongodb |
1.16.2 | 1.20.0 | 1.20.0 | 1.20.0 | 1.20.0 | 1.20.0 |
ext-newrelic (9.x) |
9.21.0.311 | 9.21.0.311 | 9.21.0.311 | 9.21.0.311 | - | - |
ext-newrelic (10.x) |
10.22.0.12 | 10.22.0.12 | 10.22.0.12 | 10.22.0.12 | 10.22.0.12 | 10.22.0.12 |
ext-newrelic (11.x) |
11.3.0.16 | 11.3.0.16 | 11.3.0.16 | 11.3.0.16 | 11.3.0.16 | 11.3.0.16 |
ext-oauth |
2.0.9 | 2.0.9 | 2.0.9 | 2.0.9 | 2.0.9 | 2.0.9 |
ext-pcov |
1.0.11 | 1.0.11 | 1.0.11 | 1.0.11 | 1.0.11 | 1.0.11 |
ext-phalcon (4.x) |
4.1.3 | 4.1.3 | - | - | - | - |
ext-phalcon (5.x) |
- | 5.4.0 | 5.8.0 | 5.8.0 | 5.8.0 | 5.8.0 |
ext-pq |
2.2.3 | 2.2.3 | 2.2.3 | 2.2.3 | 2.2.3 | 2.2.3 |
ext-psr |
1.2.0 | 1.2.0 | 1.2.0 | 1.2.0 | 1.2.0 | 1.2.0 |
ext-raphf |
2.0.1 | 2.0.1 | 2.0.1 | 2.0.1 | 2.0.1 | 2.0.1 |
ext-rdkafka (4.x) |
4.1.2 | 4.1.2 | - | - | - | - |
ext-rdkafka (5.x) |
5.0.2 | 5.0.2 | 5.0.2 | 5.0.2[2] | - | - |
ext-rdkafka (6.x) |
6.0.5 | 6.0.5 | 6.0.5 | 6.0.5 | 6.0.5 | 6.0.5 |
ext-redis (5.x) |
5.3.7 | 5.3.7 | 5.3.7 | 5.3.7 | 5.3.7[3] | - |
ext-redis (6.x) |
6.0.2 | 6.1.0 | 6.1.0 | 6.1.0 | 6.1.0 | 6.1.0 |
ext-uuid |
1.2.1 | 1.2.1 | 1.2.1 | 1.2.1 | 1.2.1 | 1.2.1 |
[1]: This extension is not available on the heroku-20 stack.[2]: This extension is not available on the heroku-22 stack.[3]: This extension is not available on the heroku-24 stack.
|
Columns marked up with yellow text and background indicate a PHP release series that is only receiving security updates from the upstream maintainers. Columns marked up with red text and background indicate a PHP release series that is fully end-of-life and no longer receiving updates of any kind from the upstream maintainers and is no longer supported by Heroku.
Using Optional Extensions
See Managing PHP Extensions for info on using optional extensions.
Available Composer Versions
The following Composer versions are available:
Composer / series | heroku-20 |
heroku-22 |
heroku-24 |
---|---|---|---|
Composer 1.x | 1.10.27 | - | - |
Composer 2 LTS | 2.2.24 | 2.2.24 | 2.2.24 |
Composer 2.x | 2.8.3 | 2.8.3 | 2.8.3 |
Composer 2.2 is the Long-Term Support (LTS) series of Composer, and will be used for builds of applications with a lock file generated by Composer 2.0, 2.1, or 2.2, or by applications using PHP versions older than 7.2.5.
Available Web Servers
The following web server versions are supported, and will automatically be installed during a build:
Web Server / series | heroku-20 |
heroku-22 |
heroku-24 |
---|---|---|---|
Apache 2.x | 2.4.62 | 2.4.62 | 2.4.62 |
Nginx 1.x | 1.26.2 | 1.26.2 | 1.26.2 |
Behavior
See Heroku PHP Behavior to learn more about how Heroku handles PHP applications.
Customer Support
You can submit issues via one of the Heroku Support channels.