就在我升级我的php到PHP7.4之后,我现在收到这个错误,
Declaration of Illuminate\Container\Container::get($id) must be compatible with
Psr\Container\ContainerInterface::get(string $id)
/home/forge/myapp.com/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 15
我已经尝试运行作曲家更新,但它现在仍然有效,可能是什么问题,我该如何解决这个问题。
通过以下命令删除您的作曲家缓存:
composer clearcache
然后删除供应商文件夹并运行作曲家安装
。我希望这个解决方案对您有所帮助。
问题是在升级后PHP我必须更新nginx vhost在sudo nan /etc/nginx/sites-available/nginx_vhost
通过更改旧的PHP7.1-fpm. sock到PHP7.4-fpm.sock从
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
}
到
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}