Laravel公用文件夹显示500内部服务器错误



我最近在CPanel中通过softaculous安装了laravel。安装后,当我试图打开网站时,它显示500内部服务器错误。事实上,我是拉拉威尔的初学者。我从error_log中得到以下错误。

[08-Aug-2020 12:56:03 UTC] PHP Fatal error:  Declaration of CarbonTranslator::setLocale($locale) must be compatible with SymfonyContractsTranslationLocaleAwareInterface::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 IlluminateHttpResponse::setContent($content) should be compatible with SymfonyComponentHttpFoundationResponse::setContent(?string $content) in /home/hugar/public_html/jityo.com/vendor/laravel/framework/src/Illuminate/Http/Response.php:14

我们将不胜感激!。

检查服务器php版本和laravel框架的composer.json文件中的php版本,如果不匹配,则必须更改服务器php版本,这将非常有效。这也发生在我身上。

服务器上的php版本(7.1(低于composer.json(7.2(.中的php版本

通过升级服务器上的php版本(7.4(修复了该问题。

最新更新