我收到此错误"Your Composer dependencies require a PHP version " >= 7.4.9 ". You are running 7.4.8. "



Composer在您的平台中检测到问题:您的Composer依赖项需要PHP版本"gt;=7.4.9";。您正在运行7.4.8。在第24行的/home/vol14_1/beythost.com/b5_28703730/htdocs/vendor/composer/platform_check.php中

这是我的composer.json文件

{
"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"
]
}
}

我正在使用"laravel/framework":"8.0〃。。。。v8.42.1

这是我的作曲家

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

我的php版本php 7.4.15(cli(,这是文档因此,我假设您的包需要更高版本的php,我建议您在添加任何包时要小心,始终通过在https://packagist.org/,也总是坚持使用laravel的php版本,而不是提供什么包。您不希望您的应用程序随着php版本更新而升级,可能会有一些错误修复或新功能,因为其他包不适合更高版本的php,因此可能会破坏您的应用软件。

现在让我们假设,如果你真的想使用这个包,你可以通过提及它的版本来使用这个包——比如这个composer require package_owner/package_name:0.1检查这个线程

我使用mac,遇到了类似(或相同(的问题。

我的php版本是正确的,但composer看到了一个较低的版本。

在更新composer的不同尝试之后,我不得不通过从主目录中删除composer来全局卸载它。

在您的终端上运行which composer以了解您的位置。

然后我运行以下程序来重新安装composer(查看composer的网站以获取最新版本(:

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');"

我不得不重新安装laravel安装程序和代客泊车,然后才能重新开始运行。

我希望这能有所帮助。

相关内容

  • 没有找到相关文章

最新更新