2

嗨,我是Apigility的新手。我正在尝试配置教义-orm-module。当我尝试运行下面的命令并收到此错误时

$ cd /var/www/apigility/zf-apigility-skeleton/vendor/doctrine/doctrine-module/bin
$ php doctrine-module.php

错误是:

PHP Fatal error:  Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for doctrine.cli' in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529
Stack trace:
#0 /var/www/apigility/zf-apigility-skeleton/vendor/doctrine/doctrine-module/bin/doctrine-module.php(51): Zend\ServiceManager\ServiceManager->get('doctrine.cli')
#1 {main} thrown in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 529

Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for doctrine.cli' in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:529
Stack trace:
#0 /var/www/apigility/zf-apigility-skeleton/vendor/doctrine/doctrine-module/bin/doctrine-module.php(51): Zend\ServiceManager\ServiceManager->get('doctrine.cli')
#1 {main} thrown in /var/www/apigility/zf-apigility-skeleton/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 529

我遵循了DoctrineORMModule 的 readme.md上的安装指南

4

1 回答 1

2

您不需要直接在 bin 文件夹中运行学说模块 cli。如果配置正确,DoctrineModule 已经将相关的控制台路由绑定到应用程序。

尝试这个:

$ cd /var/www/apigility/zf-apigility-skeleton
$ php public/index.php orm:info

希望能帮助到你。

于 2014-10-01T09:19:51.713 回答