2

我对 Zend 有奇怪的问题。它在本地主机和开发机器上工作正常。但在生产中它给出错误 Invalid controller specified (receipt)

Request Parameters:
array (
  'controller' => 'receipt',
  'action' => 'create',
  'module' => 'default',
)  

我的应用程序 .ini 是

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
resources.frontController.moduleControllerDirectoryName = "controllers"
resources.frontController.params.prefixDefaultModule = ""

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.view[] = 

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

任何帮助,将不胜感激

4

2 回答 2

2

很可能是区分大小写的问题。确保控制器的文件名以大写字母 (ReceiptController.php) 开头,并且目录名是小写的(模块、控制器)。

于 2013-07-24T19:29:41.677 回答
0

尝试删除这一行:

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"

如果它仍然不起作用,请尝试下面的配置(仅适用于多个模块):

resources.modules[] = ""
resources.frontController.params.prefixDefaultModule = ""
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.moduleControllerDirectoryName = "controllers"
resources.frontController.defaultModule = "default"
resources.frontController.defaultControllerName = "index"
resources.frontController.defaultAction = "index"
resources.frontController.env = APPLICATION_ENV

对不起我英语说得不好

于 2013-07-25T01:19:39.357 回答