简体   繁体   English

尝试更新作曲家时出现 API 错误和 php

[英]API error when trying to update composer and php

I had this errror in first instance:我首先遇到了这个错误:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". Composer 在您的平台中检测到问题:您的 Composer 依赖项需要 PHP 版本“>= 8.0.2”。 You are running 7.4.27.您正在运行 7.4.27。 in /opt/lampp/htdocs/proyectoCartas/vendor/composer/platform_check.php on line/opt/lampp/htdocs/proyectoCartas/vendor/composer/platform_check.php线上

later I solved it by adding后来我通过添加解决了它

    "platform-check": false

in composer.json config object then i executed: php artisan config:cache php composer.phar dump-autoload在 composer.json config object 然后我执行了: php artisan config:cache php composer.phar dump-autoload

and still get this error, which I can't solve:仍然出现此错误,我无法解决:

Fatal error: Uncaught TypeError: Return value of Illuminate\Container\Container::offsetGet() must be an instance of Illuminate\Container\mixed, instance of Illuminate\Events\Dispatcher returned in /opt/lampp/htdocs/proyectoCartas/vendor/laravel/framework/src/Illuminate/Container/Container.php:1417致命错误:Uncaught TypeError: Illuminate\Container\Container::offsetGet() 的返回值必须是 Illuminate\Container\mixed 的实例,Illuminate\Events\Dispatcher 的实例在 /opt/lampp/htdocs/proyectoCartas/vendor/ 中返回laravel/framework/src/Illuminate/Container/Container.php:1417

Thanks in advance提前致谢

Since you didn't say which version of Laravel you're using, I assume it's the latest (9).由于您没有说明您使用的是哪个版本的 Laravel,我认为它是最新的 (9)。 If so, you will have to update the PHP version, it has the minimum requirement of PHP version 8如果是这样,您将必须更新 PHP 版本,它具有 PHP 版本 8 的最低要求

Server requirements Laravel 9 服务器要求 Laravel 9

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM