我和Zend有个奇怪的问题。它在localhost和开发机器上运行良好。但在生产时它会给出错误指定的无效控制器(收据)
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
任何帮助将不胜感激
答案 0 :(得分:2)
最有可能是区分大小写的问题。确保控制器的文件名以大写字母(ReceiptController.php)开头,目录名称为小写(模块,控制器)。
答案 1 :(得分: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
对不起,我说英语不太好