Question

How to upgrade Heroku stack to get PHP8.2

Getting this error when building a Laravel PHP 8.2 solution:

6:36:05] │ -----> Installing platform packages...
[2023-04-27 16:36:08] │ 
[2023-04-27 16:36:08] │  !     ERROR: Failed to install system packages!
[2023-04-27 16:36:08] │  !     
[2023-04-27 16:36:08] │  !     Your platform requirements (for runtimes and extensions) could
[2023-04-27 16:36:08] │  !     not be resolved to an installable set of dependencies, or a
[2023-04-27 16:36:08] │  !     platform package repository was unreachable.
[2023-04-27 16:36:08] │  !     
[2023-04-27 16:36:08] │  !     This usually means that you (or packages you are using) depend
[2023-04-27 16:36:08] │  !     on a combination of PHP versions and/or extensions that are
[2023-04-27 16:36:08] │  !     currently not available on Heroku.
[2023-04-27 16:36:08] │  !     
[2023-04-27 16:36:08] │  !     The following is the full output from the installation attempt:
[2023-04-27 16:36:08] │  !     
[2023-04-27 16:36:08] │  !     > Loading repositories with available runtimes and extensions
[2023-04-27 16:36:08] │  !     > Updating dependencies
[2023-04-27 16:36:08] │  !     > Your requirements could not be resolved to an installable set of packages.
[2023-04-27 16:36:08] │  !     > 
[2023-04-27 16:36:08] │  !     >   Problem 1
[2023-04-27 16:36:08] │  !     >     - composer.json/composer.lock requires php ^8.2.0 -> found php[7.1.33, ..., 7.4.33, 8.0.0, ..., 8.1.18] but it does not match the constraint.
[2023-04-27 16:36:08] │  !     > 
[2023-04-27 16:36:08] │  !     > Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.
[2023-04-27 16:36:08] │  !     
[2023-04-27 16:36:08] │  !     For reference, the following runtimes are currently available:
[2023-04-27 16:36:08] │  !     
[2023-04-27 16:36:08] │  !     PHP:  8.1.18, 8.1.17, 8.1.16, 8.1.15, 8.1.14, 8.1.13, 8.1.12, 
[2023-04-27 16:36:08] │  !     8.1.11, 8.1.10, 8.1.9, 8.1.8, 8.1.7, 8.1.6,
.......
8.1.5, 8.1.4,7.2.30, 
[2023-04-27 16:36:08] │  !     7.2.29, 7.2.28, 7.2.27

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
April 27, 2023
Accepted Answer

Hey @musdev,

UPDATE: PHP 8.2 is now available and the docs have been updated:

https://docs.digitalocean.com/products/functions/reference/runtimes/php/

Indeed PHP 8.2 is not yet available on the App Platform. The latest PHP version available is 8.1.18 as of the time of writing this post.

The best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.

https://ideas.digitalocean.com/

I will forward your feedback internally as well!

As an alternative approach, you could use a Dockerfile rather than the PHP buildpack to deploy your application:

https://docs.digitalocean.com/products/app-platform/reference/dockerfile/

Hope that helps!

- Bobby.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more