-1

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 ?

matiaslauriti
  • 7,065
  • 4
  • 31
  • 43
  • You can try these answers at here https://stackoverflow.com/questions/72846653/your-composer-dependencies-require-a-php-version-8-1-0 – Paul J.K Feb 23 '23 at 02:39

2 Answers2

0

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/php@7.0
brew install shivammathur/php/php@7.1
brew install shivammathur/php/php@7.2
brew install shivammathur/php/php@7.3
brew install shivammathur/php/php@7.4
brew install shivammathur/php/php@8.0
brew install shivammathur/php/php@8.1
brew install shivammathur/php/php@8.2

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

brew link --overwrite --force php@8.1

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

Here we go again
  • 465
  • 4
  • 13
-1

Search 'composer.json' on your laravel folder then you find this :

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

change that version to "^8.1.0"

Retaker
  • 33
  • 6