View categories

Categories

Last updated January 09, 2026

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, PHP 8.3, PHP 8.4 and PHP 8.5 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 has been fully end-of-life since the end of 2025 and will not receive further updates of any kind from the PHP maintainers.

PHP 8.2 and PHP 8.3 are in security-only maintenance mode and will be fully end-of-life at the end of 2026 (PHP 8.2) and 2027 (PHP 8.3). Only critical security fixes will be provided by the PHP maintainers for these release series.

We encourage users to update their applications to PHP 8.4 or PHP 8.5. 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.

Runtime / series heroku-22 heroku-24
PHP 8.1 8.1.34 -
PHP 8.2 8.2.30 8.2.30
PHP 8.3 8.3.29 8.3.29
PHP 8.4 8.4.16 8.4.16
PHP 8.5 8.5.1 8.5.1

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, will receive the latest available version of PHP 8.4, unless requirements for extensions constrain resolution to an older supported version.

Extensions

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 8.1 PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
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-lexbor - - - -
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-uri - - - -
ext-xml
ext-xmlreader
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 8.1 PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
ext-amqp (1.x) 1.11.0 1.11.0​[​2​] - - -
ext-amqp (2.x) 2.1.2 2.1.2 2.1.2 2.1.2 -
ext-apcu 5.1.28 5.1.28 5.1.28 5.1.28 5.1.28
ext-blackfire 1.92.53 1.92.53 1.92.53 1.92.53 1.92.53
ext-ev 1.2.2 1.2.2 1.2.2 1.2.2 1.2.2
ext-event 3.1.4 3.1.4 3.1.4 3.1.4 3.1.4
ext-grpc 1.76.0 1.76.0 1.76.0 1.76.0 -
ext-imagick 3.8.1 3.8.1 3.8.1 3.8.1 3.8.1
ext-imap - - - 1.0.3 1.0.3
ext-memcached 3.4.0 3.4.0 3.4.0 3.4.0 3.4.0
ext-mongodb (1.x) 1.21.2 1.21.2 1.21.2 1.21.2 -
ext-mongodb (2.x) 2.1.4 2.1.4 2.1.4 2.1.4 2.1.4
ext-newrelic (9.x) 9.21.0.311 - - - -
ext-newrelic (10.x) 10.22.0.12 10.22.0.12 10.22.0.12 - -
ext-newrelic (11.x) 11.10.0.24 11.10.0.24 11.10.0.24 11.10.0.24 -
ext-newrelic (12.x) 12.2.0.27 12.2.0.27 12.2.0.27 12.2.0.27 -
ext-oauth 2.0.10 2.0.10 2.0.10 2.0.10 2.0.10
ext-pcov 1.0.12 1.0.12 1.0.12 1.0.12 1.0.12
ext-phalcon 5.9.3 5.9.3 5.9.3 5.9.3 -
ext-pq 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
ext-raphf 2.0.2 2.0.2 2.0.2 2.0.2 2.0.2
ext-rdkafka 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​[​2​] - - -
ext-redis (6.x) 6.3.0 6.3.0 6.3.0 6.3.0 6.3.0
ext-uuid 1.3.0 1.3.0 1.3.0 1.3.0 1.3.0
[1]: This extension is not available on the heroku-22 stack.
[2]: 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.

Composer

Available Composer Versions

The following Composer versions are available:

Composer / series heroku-22 heroku-24
Composer 2 LTS 2.2.25 2.2.25
Composer 2.x 2.9.2 2.9.2

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.

Web Servers

Available Web Servers

The following web server versions are supported, and will automatically be installed during a build:

Web Server / series heroku-22 heroku-24
Apache 2.x 2.4.66 2.4.66
Nginx 1.x 1.28.0 1.28.0

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.

Additional Reading