Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CodeBuild Error, unsupported runtime version PHP 8.0

I am working with AWS CodeBuild, I am facing this issue where I am building a docker image for deployment. However, I am facing this issue where AWS shows me the error message of Unknown runtime version named '8.0' of php. This build image has the following versions: 7.3, 7.4 However, in the documentation it says that it supports PHP V 8.0. Note that I am working with Laravel 9.0 with Laravel Sail, MySQL, Redis and MailHog containers.

I am attaching my buildspec.yml file for reference

version: 0.2

phases:
  install:
    runtime-versions: 
      php: 8.0
    commands:
      - echo "PHP Version ⬇"
      - php -v
      - echo "Initiation of build 🏠"
      - echo "Installing Composer 🎺"
      - curl -s https://getcomposer.org/installer | php
      - mv composer.phar /usr/local/bin/composer
      - echo "Installing dependencies 📦"
      - composer install
      - echo "Installed dependencies 📦"

  build:
    commands:
      - echo "Building 🏗"
      - composer build
      - echo "Built 🏗"

  post_build:
    commands:
      - echo "Post build 🏗"
      - echo "Build completed on `date` 🏗"

like image 515
runtimeTerror Avatar asked Nov 28 '25 04:11

runtimeTerror


1 Answers

Php 8.0 is only supported if you use Ubuntu standard:5.0 CodeBuild image. The fact that you are getting your error, means that you use different image then Ubuntu standard:5.0.

like image 172
Marcin Avatar answered Nov 29 '25 18:11

Marcin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!