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

走远了吗. 提交于 2019-12-24 18:40:07

问题


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:


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



来源:https://stackoverflow.com/questions/46454907/php-error-at-runtime-interface-psr-container-containerinterface-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!