0

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"
        ]
    }
}
surfmuggle
  • 5,527
  • 7
  • 48
  • 77
  • which php version are you using .just check php --version – John Lobo May 28 '21 at 03:41
  • And what's your question about this? Is there anything unclear about the given error message? – Nico Haase May 28 '21 at 07:20
  • 1
    This line `"php": "^7.4.9|^8.0",` requires that your PHP Version must be at least 7.4.9 or higher. The error you get states that your current php version 7.4.8. does not fullfill this requirement. You have to upgrade your php version or see if you can reduce the requirements in your composer.json file. – surfmuggle May 28 '21 at 21:20

2 Answers2

0

I am using "laravel/framework": "^8.0", .... v8.42.1

this is my composer

 "require": {
        "php": "^7.3",
        ......
        "laravel/framework": "^8.0",
        ......
    },

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 thread

Vipertecpro
  • 3,056
  • 2
  • 24
  • 43
0

I 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):

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

I had to re-install laravel installer and valet before I was able to get running again.

I hope this helps.

Willower
  • 1,099
  • 8
  • 22