【发布时间】:2014-08-06 05:42:54
【问题描述】:
我在共享托管服务器中托管了我的 Zend Framework 2 应用程序。我上传了 public_html 根文件夹中的所有文件。我将以下代码放在 public 文件夹内的 index.php 文件中。
error_reporting(E_ALL);
ini_set("display_errors", 1);
现在我正在尝试像 test.com/public 一样浏览我的应用程序并收到以下错误。
Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (test) could not be initialized.' in /home/nowphp/public_html/zend_test/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php:175 Stack trace:
#0 /home/nowphp/public_html/zend_test/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php(149): Zend\ModuleManager\ModuleManager->loadModuleByName(Object(Zend\ModuleManager\ModuleEvent))
#1 /home/nowphp/public_html/zend_test/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php(90): Zend\ModuleManager\ModuleManager->loadModule('test')
#2 [internal function]: Zend\ModuleManager\ModuleManager->onLoadModules(Object(Zend\ModuleManager\ModuleEvent))
#3 /home/nowphp/public_html/zend_test/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent))
#4 /home/nowphp/public_html/zend_test/vendor/zendframework/zendframework/library/Z in /home/nowphp/public_html/zend_test/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php on line 175
我尝试了很多但未能解决问题。有人可以在这方面帮助我吗??
谢谢
【问题讨论】:
-
假设您首先在本地机器上开发了它,它在那里可以正常工作吗?
-
感谢@TimFountain 的回复。是的,我在本地机器上开发了它,它在那里运行良好。
-
在这种情况下,很可能是区分大小写的问题。测试模块的
Module.php的完整路径(包括文件名)是什么? -
感谢@TimFountain 的宝贵回复。你猜对了,这是区分大小写的问题。你能说我如何从 URL 中删除 public 字吗?谢谢
标签: zend-framework2 web-hosting