skip to Main Content

if I check my laravel version it running php 7.1.33

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0". You are running 7.1.33. in /Users/mymac/.composer/vendor/composer/platform_check.php on line 24

but when i check my php there is 8.1.12 version

PHP 8.1.12 (cli) (built: Nov 21 2022 12:01:33) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.12, Copyright (c) Zend Technologies

how can i delete php 7.1.33 or switch to php 8.1.0 ?

2

Answers


  1. Search ‘composer.json’ on your laravel folder then you find this :

       "require": {
            "php": "^7.3",
    

    change that version to "^8.1.0"

    Login or Signup to reply.
  2. It depends on how you installed PHP on your mac.

    I’ve installed php versions using one of the below through brew

    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    

    Then if I want to change versions (due to different project requirements) I use the below command

    brew link --overwrite --force [email protected]
    

    swapping out the 8.1 for the version that you need.

    My information is from This link here and I found it to work well for me

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