php error at runtime Interface 'Psr\Container\ContainerInterface' not found

6.1k views Asked by At

I recently uploaded a new dependency to a PHP app I am working on and I am now continually getting the following error in Postman

Fatal error: Interface 'Psr\Container\ContainerInterface' not found in /var/www/html/api/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php on line 13

I have updated composer as well as a multitude of other things and still cannot seem to pinpoint the issue. (Also not sure if it means the error is with the index.php file or the container.php file)

Here is the code from the container.interface.php file

<?php
/**
 * @license http://www.opensource.org/licenses/mit-license.php MIT 
(see the LICENSE file)
 */

namespace Interop\Container;

use Psr\Container\ContainerInterface as PsrContainerInterface;

/**
 * Describes the interface of a container that exposes methods to 
   read its entries.
 */
   interface ContainerInterface extends PsrContainerInterface
   {
   }

And here is the initial code from my index.php file

<?php

ini_set('display_errors', 1);

// Include the SDK using the Composer autoloader
require 'vendor/autoload.php';
use Kreait\Firebase\Factory;
use Kreait\Firebase\ServiceAccount;

// Includes ;
require_once( 'config/database.php' );
require_once( 'controller/base.php' );



//$app = new Slim\App();
 $app = new Slim\App(['settings' => ['displayErrorDetails' => true]]);

 $twilio = new Twilio\Rest\Client(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN);
     $serviceAccount = ServiceAccount::fromJsonFile('my_file.json');
     $firebase = (new Factory)->withServiceAccount($serviceAccount)-
      >withDatabaseUri('my_firebase_website')->create();
1

There are 1 answers

0
NightHawk95 On

Solution: I was utilizing filezilla to transfer updated dependencies from my vendor folder on my local machine & in the process I was downloaded the wrong autoload.php file