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
Search ‘composer.json’ on your laravel folder then you find this :
change that version to
"^8.1.0"
It depends on how you installed PHP on your mac.
I’ve installed php versions using one of the below through brew
Then if I want to change versions (due to different project requirements) I use the below command
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