I'm trying to setup my fresh laravel 7 application but I got below errors:
2020/03/08 15:05:05 [error] 12519#12519: *1 FastCGI sent in stderr: "PHP message: PHP Warning: Declaration of Illuminate\Http\Request::get($key, $default = NULL) should be compatible with Symfony\Component\HttpFoundation\Request::get(string $key, $default = NULL) in /var/www/myapp/vendor/laravel/framework/src/Illuminate/Http/Request.php on line 20
PHP message: PHP Fatal error: Declaration of Carbon\Translator::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) in /var/www/myapp/vendor/nesbot/carbon/src/Carbon/Translator.php on line 18
PHP message: PHP Fatal error: Uncaught TypeError: Return value of Symfony\Component\HttpFoundation\Response::setStatusCode() must be an instance of Symfony\Component\HttpFoundation\object, instance of Symfony\Component\HttpFoundation\Response returned in /var/www/myapp/vendor/symfony/http-foundation/Response.php:450
Stack trace:
#0 /var/www/myapp/vendor/symfony/http-foundation/Response.php(198): Symfony\Component\HttpFoundation\Response->setStatusCode(500)
#1 /var/www/myapp/vendor/symfony/http-foundation/Response.php(214): Symfony\Component\HttpFoundation\Response->__construct('<!doctype html>...', 500, Array)
#2 /var/www/myapp/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(328): Symfony\Component\HttpFoundation\Response::create('<!doctype html>...', 500, Array)
#3 /var/www/myapp/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(305): Illuminate\Foundation\Exceptions\Handler-" while reading response header from upstream, client: 10.0.0.1, server: myapp.local, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "myapp.local"
Basically:
Sorry, was incorrectly pointed to 7.1 fpm. After changing to 7.3 all works fine.
For anyone getting this, try every php version above 7.2 you can. 7.4 worked for me
Most helpful comment
Sorry, was incorrectly pointed to 7.1 fpm. After changing to 7.3 all works fine.