skip to Main Content

Both my valet and composer is using php 8.0
But my local says

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.30. in /Users/admin/sites/sage10/web/app/themes/sage10/vendor/composer/platform_check.php on line 24

When I upgrade php with valet using 8.0 it gives

Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/admin/.composer/vendor/illuminate/container/Container.php

But at the end it says its using 8.0. and composer -vvv about also gives php 8.0

Is there more things to consider? I don’t understand why its saying I’m using 7.4…

2

Answers


  1. Chosen as BEST ANSWER

    I had a line of required package that was not needed and supported with sage 10// php8 (illuminate/support) inside my global composer file. After erasing that and linking my valet with php database and restarting it, everything started to work.


  2. Composer works on the php version is in use on command line. It is possible you have multiple version installed.
    Try to run

    php -v
    

    Then ensure composer is updated to the latest version (2.4.2)

    composer -V
    

    In case update it

    composer self-update

    If self-update gives you some runtime error, reinstall composer following the install procedure

    Then the error you get is about Laravel 6/7/8 version with PHP 8, the solution is here

    Laravel app stopped working after upgrading to php 8

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search