My deployment on app platform with my Laravel app was working recently but now, its throwing me an error
composer.json/composer.lock requires php ^7.4 -> found php[8.1.6, …, 8.2.11] but it does not match the constraint.
Looking at the deployment error, in my understanding, seems it found php8.1.
I specify php version 7.4 on the composer json
{
"name": "ddf/test",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.4",
"ext-bcmath": "*",
"ext-ctype": "*",
"ext-fileinfo": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-pdo": "*",
"ext-tokenizer": "*",
"ext-xml": "*",
"ext-curl": "*",
"ext-exif": "*",
"ext-gd": "*",
why its pointing to php8? any ideas how to resolve this issue? I’m stuck on this for days now.
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!
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
Have you by any chance tried to do a forced-redeployment so that you could clear the build cache?
If the above does not help, it is possible that PHP 7.x might not be available with the new Ubuntu 22 buildpack on the App Platform. What you could do in this case is:
Downgrade to Ubuntu 18: By modifying your app spec, you can revert to using Ubuntu 18, which should restore compatibility for your application. You can follow the instructions here: How to Change Stack.
Upgrade Your Software: If you’re keen on benefiting from the updates in Ubuntu 22, consider upgrading your software versions. Afterwards, ensure you select the correct build pack supported in the Ubuntu 22 stack. The guide on how to do this can be found here: How to Upgrade Buildpacks.
Let me know how it goes!
Best,
Bobby