Deep-dive on the Next Gen Platform. Join the Webinar!

Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
Hide categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Working with Node.js
      • Troubleshooting Node.js Apps
      • Node.js Behavior in Heroku
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • PHP Behavior in Heroku
      • Working with PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Working with AI
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Language Support
  • PHP
  • Heroku PHP Support Reference

Heroku PHP Support Reference

English — 日本語に切り替える

Last updated May 08, 2025

Table of Contents

  • PHP Runtimes
  • Extensions
  • Composer
  • Web Servers
  • Behavior
  • Customer Support
  • Additional Reading

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 and PHP 8.4 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 and PHP 8.2 are 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 these release series. We encourage users to update their applications to PHP 8.3 or PHP 8.4. 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.

The latest available version of PHP on the Fir generation of the Heroku platform is 8.3.13.

Runtime / series heroku-22 heroku-24
PHP 8.1 8.1.32 -
PHP 8.2 8.2.28 8.2.28
PHP 8.3 8.3.20 8.3.20
PHP 8.4 8.4.6 8.4.6

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.

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
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-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
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.24 5.1.24 5.1.24 5.1.24
ext-blackfire 1.92.32 1.92.32 1.92.32 1.92.32
ext-ev 1.2.0 1.2.0 1.2.0 1.2.0
ext-event 3.1.4 3.1.4 3.1.4 3.1.4
ext-grpc 1.71.0 1.71.0 1.71.0 1.71.0
ext-imagick 3.8.0 3.8.0 3.8.0 3.8.0
ext-imap - - - 1.0.3
ext-memcached 3.3.0 3.3.0 3.3.0 3.3.0
ext-mongodb (1.x) 1.21.0 1.21.0 1.21.0 1.21.0
ext-mongodb (2.x) 2.0.0 2.0.0 2.0.0 2.0.0
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.7.0.21 11.7.0.21 11.7.0.21 11.7.0.21
ext-oauth 2.0.9 2.0.9 2.0.9 2.0.9
ext-pcov 1.0.12 1.0.12 1.0.12 1.0.12
ext-phalcon 5.9.2 5.9.2 5.9.2 5.9.2
ext-pq 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
ext-raphf 2.0.1 2.0.1 2.0.1 2.0.1
ext-rdkafka 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.2.0 6.2.0 6.2.0 6.2.0
ext-uuid 1.2.1 1.2.1 1.2.1 1.2.1
[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.8.8 2.8.8

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 Fir generation of the Heroku platform does not support Nginx.

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.63 2.4.63
Nginx 1.x 1.26.3 1.26.3

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

  • Getting Started on Heroku with PHP
  • Getting Started with Laravel on Heroku.
  • Heroku PHP Behavior
  • Deploying PHP Apps on Heroku

Keep reading

  • PHP

Feedback

Log in to submit feedback.

Scaling a Laravel Application with Memcache Scaling a Laravel Application with Memcache

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure
  • .NET

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices