ZF2主干应用程序抛出500错误(ZF2 skeleton application is throw

2019-09-01 21:16发布

当尝试使用下面的命令来部署框架应用程序:

git clone git://github.com/zendframework/ZendSkeletonApplication.git
cd ZendSkeletonApplication
php composer.phar self-update
php composer.phar install

我得到以下错误:

PHP Fatal error: Uncaught exception 'Zend\\ServiceManager\\Exception\\InvalidArgumentException' with message 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' in /home/web/www/zftests/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:302\nStack trace:\n#0 /home/web/www/zftests/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/ServiceManager/Config.php(126): Zend\\ServiceManager\\ServiceManager->addAbstractFactory('Zend\\Cache\\Serv...')\n#1 /home/web/www/zftests/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListener.php(223): Zend\\ServiceManager\\Config->configureServiceManager(Object(Zend\\ServiceManager\\ServiceManager))\n#2 [internal function]: Zend\\ModuleManager\\Listener\\ServiceListener->onLoadModulesPost(Object(Zend\\ModuleManager\\ModuleEvent))\n#3 /home/web/www/zftests/ZendSkeletonApplication/vendor/zendframework/zendframework/library in /home/web/www/zftests/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 302

Answer 1:

这工作就好了。 问题是,有两个文件从ZF2.5框架中缺失。

  'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
  'Zend\Log\LoggerAbstractServiceFactory',

谢谢,加里



Answer 2:

请评论模块/应用/配置/ module.config.php发现下面几行

      'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
      'Zend\Log\LoggerAbstractServiceFactory',

骨架应用程序将正常工作。

谢谢



Answer 3:

非常感谢大家! 貌似现在的解决方案是克隆2.1标签,如@weierophinney这里所说: https://github.com/zendframework/ZendSkeletonApplication/commit/80884b7da866f5136654c83604c1270a3228b7b9

git clone -b "zf/release-2.1.0" https://github.com/zendframework/ZendSkeletonApplication.git ./
php composer.phar self-update
php composer.phar install


文章来源: ZF2 skeleton application is throwing 500 error