I have recently installed laravel through softaculous in CPanel. After the installation, when I tried to open the website, it shows 500 Internal Server Error. Actually, I am a beginner in Laravel. The following errors I got from 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
Every assistance will be appreciated!.
2
Answers
The php version(7.1) on the server was lesser than php version in composer.json(7.2).
The problem fixed by upgrading the php version(7.4) on the server.
Check the server php version and the php version in composer.json file of laravel framework, if it’s not a match then you have to change the server php version and it will work like a charm. this happened with me as well.