1

Just After I Upgraded my php to PHP 7.4 I'm now getting this error,

Declaration of Illuminate\Container\Container::get($id) must be compatible with 
Psr\Container\ContainerInterface::get(string $id)
/home/forge/myapp.com/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 15

I've tried to run Composer Update But it's Still now Working what could be the problem and How do I fix this.

Wells
  • 142
  • 1
  • 13

2 Answers2

0

Remove your composer cache by the command below:

composer clearcache

Then remove the vendor folder and run composer install. I hope this solution help you.

Hedayatullah Sarwary
  • 2,664
  • 3
  • 24
  • 38
0

the Problem was after upgrading PHP I had to update the nginx vhost at sudo nano /etc/nginx/sites-available/nginx_vhost by changing the old PHP7.1-fpm.sock to PHP7.4-fpm.sock From

    location ~ \.php$ {
 
        fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
   
    }

To

    location ~ \.php$ {
 
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
   
    }
Wells
  • 142
  • 1
  • 13