1
votes

Two weeks ago I didn't have any problem, but today this appears when I put composer install

Loading composer repositories with package information

Installing dependencies (including require-dev) from lock file

Nothing to install or update

Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump PHP Fatal error: Interface 'Psr\Container\ContainerInterface' not found in /opt/lampp/htdocs/nuevodirectorio/ClinicaLaravel/vendor/laravel/framework/src/Illuminate/Contracts/Container/Container.php on line 8

Fatal error: Interface 'Psr\Container\ContainerInterface' not found in /opt/lampp/htdocs/nuevodirectorio/ClinicaLaravel/vendor/laravel/framework/src/Illuminate/Contracts/Container/Container.php on line 8

Here is part of the code of Container.php:

<?php
  namespace Illuminate\Container;

  use Closure;
  use Exception;
  use ArrayAccess;
  use LogicException;
  use ReflectionClass;
  use ReflectionParameter;
  use Illuminate\Support\Arr;
  use Illuminate\Contracts\Container\BindingResolutionException;
  use Illuminate\Contracts\Container\Container as ContainerContract;

  class Container implements ArrayAccess, ContainerContract
  {
   ...
  }
2
That is not the file causing the problem. I'd suggest just reinstalling everything with rm composer.lock && composer installmiken32

2 Answers

3
votes

At my job we have the same problem. In our case, there was a psr/container file causing a conflict, but this file was in the composer global cache, so remove the vendor folder doesn't help us. The solution we found was to clear the composer cache using this command:

composer clearcache

then we remove the vendor folder and run composer install, everything goes fine. I hope this solution help someone.

0
votes

I had the same issue.

Still investigating, but what I discovered so far is that, running composer install --no-dev [...], I have the package psr/container in vendor/psr/container in vendors, but 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), line missing in vendor/composer/autoload_psr4.php.

For the time being, I fixed it including dev dependencies, until I figure out the real fix.