2010-06-08 81 views
0

我是新来的zend框架。Zend Framework - Zend Tool - 模块错误:我使用Zend Tool创建模块后出现错误

我用zend工具创建了一个zend项目,它的作品。然后我尝试创建一个模块,但是当我尝试使用浏览器访问它时,出现错误。

我的步骤:

  1. $ sudo zf create project mystore
  2. Zend库库内

测试http://localhost/mystore/public/工作

添加模块存储(不工作

  • $ sudo zf create module store
  • 添加到的application.ini路径模块

    resources.frontController.moduleDirectory = APPLICATION_PATH“/modules“

    resources.modules =”“

  • TEST1:http://localhost/mystore/public/store/

    TEST2:http://localhost/mystore/public/store/public/

    TEST3:http://localhost/mystore/public/modules/store/public/

    TEST1 + 2 + 3的结果:

    An error occurred 
    Page not found 
    Exception information: 
    
    Message: Invalid controller specified (index.php) 
    Stack trace: 
    
    #0 /var/www/mystore/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) 
    #1 /var/www/mystore/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch() 
    #2 /var/www/mystore/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() 
    #3 /var/www/mystore/public/index.php(25): Zend_Application->run() 
    #4 {main} 
    
    Request Parameters: 
    
    array (
        'module' => 'store', 
        'controller' => 'index.php', 
        'action' => 'index', 
    ) 
    

    谢谢,

    约瑟夫

    回答

    1

    我忘了让这个命令创建我的模块的索引控制器。

    $ sudo zf create controller index index-action-included=1 store 
    
    1

    其他动作/控制器是否在标准安装上工作,在添加模块之前的情况(网址为http://localhost/mystore/public/)?这可能可能导致.htaccess文件中的重写规则有问题。

    Zend中的路由似乎认为,当你访问你的模块时,控制器是index.php。

    +0

    他们在我添加模块之前工作。 现在也是http:// localhost/mystore/public/works。 – Yosef 2010-06-08 13:15:26