Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony\Component\Debug\Exception\FatalErrorException laravel Error

Tags:

php

laravel

I am getting this error on my new Laravel project. I am trying to run after a fresh installation.

Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale)

like image 861
Kuldeep Raj Avatar asked Nov 21 '19 12:11

Kuldeep Raj


1 Answers

On my server following were configurations:

PHP 7.1.26-1+ubuntu14.04.1+deb.sury.org+1 Laravel Framework 5.7.28

Solution: Added "symfony/translation": "4.3.8" in composer.json as follows

"require": {      ...      "symfony/translation": "4.3.8", } 

and then

composer update 

or (if php version is not recommended on the server)

composer update --ignore-platform-reqs

like image 169
zarpio Avatar answered Sep 18 '22 16:09

zarpio