【发布时间】:2020-11-28 14:47:45
【问题描述】:
我最近在 CPanel 中通过 softaculous 安装了 laravel。安装后,当我尝试打开网站时,它显示 500 Internal Server Error。实际上,我是 Laravel 的初学者。我从 error_log 得到以下错误。
[08-Aug-2020 12:56:03 UTC] PHP Fatal error: Declaration of Carbon\Translator::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) in /home/hugar/public_html/jityo.com/vendor/nesbot/carbon/src/Carbon/Translator.php on line 18
[08-Aug-2020 12:56:03 UTC] PHP Fatal error: Uncaught ErrorException: Declaration of Illuminate\Http\Response::setContent($content) should be compatible with Symfony\Component\HttpFoundation\Response::setContent(?string $content) in /home/hugar/public_html/jityo.com/vendor/laravel/framework/src/Illuminate/Http/Response.php:14
我们将不胜感激!
【问题讨论】:
-
你已经在不同的 php 版本上安装了 laravel 版本。请检查您的 composer.json 文件和服务器上的 php 版本。
-
"require": { "php": "^7.2.5", ...... } -
哦,对不起。在 phpinfo() 上是 7.1.33;
-
好的,谢谢。通过升级版本修复。