Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.4.9". You are running 7.4.8. in /home/vol14_1/byethost5.com/b5_28703730/htdocs/vendor/composer/platform_check.php on line 24
this is my composer.json file
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.4.9|^8.0",
"algolia/algoliasearch-client-php": "^3.0",
"anandsiddharth/laravel-paytm-wallet": "^2.0",
"barryvdh/laravel-dompdf": "^0.9.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"intervention/image": "^2.5",
"laravel/framework": "^8.0",
"laravel/helpers": "^1.4",
"laravel/nexmo-notification-channel": "^2.5",
"laravel/scout": "^9.1",
"laravel/socialite": "^5.2",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.0",
"laravelcollective/html": "^6.2",
"milon/barcode": "^8.0",
"monarobase/country-list": "^3.2",
"paypal/rest-api-sdk-php": "^1.14",
"phpmailer/phpmailer": "^6.4",
"razorpay/razorpay": "^2.6",
"stripe/stripe-php": "^7.77",
"uxweb/sweet-alert": "^2.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
2
Answers
I am using "laravel/framework": "^8.0", …. v8.42.1
this is my composer
my php version PHP 7.4.15 (cli), here is the doc
so i am assuming that one your package is required higher version of php, i would suggest please be careful while adding any package, always check the minimum php requirement of that package by checking that package on https://packagist.org/ , also always stick with the php version of laravel, instead of what package has to give. You don’t want your application to be upgrading as php version updates, there could be some bug fix or new feature which may break your application because other packages are not suitable for higher version of php.
Now let’s say if you do want to use that package, you can use that package by mentioning it’s version something like this
composer require package_owner/package_name:0.1
check this threadI use a mac and I ran into a similar (or maybe the same) issue.
My php version was correct but composer was seeing a lower version.
After different trials of updating composer, I had to uninstall composer globally by deleting it from my home directory.
Run
which composer
on your terminal to know where yours is located.Then I ran the following to reinstall composer(Check composer’s website for the latest version of this):
I had to re-install laravel installer and valet before I was able to get running again.
I hope this helps.