dongsou0083
2015-04-28 14:20
浏览 40
已采纳

安装zend Framework后,codeigniter无法正常工作

I am using Ubuntu 14.04. i have done a project using codeigniter and that was working fine. but now i thought of learning zend framework and installed zend framework 1.12.3 on my machine using this tutorial Digital Ocean.

When i tried to access the new project i have created http://localhost/ZendApp i get this error

        An error occurred
        Page not found
        Exception information:

        Message: Invalid controller specified (ZendApp)
        Stack trace:

        #0 /home/ZendFramework-1.12.3/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
        #1 /home/ZendFramework-1.12.3/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
        #2 /home/ZendFramework-1.12.3/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
        #3 /var/www/html/ZendApp/public/index.php(26): Zend_Application->run()
        #4 {main}  

        Request Parameters:

        array (
          'controller' => 'ZendApp',
          'action' => 'index',
          'module' => 'default',
        )  

And When i try to access my old project, i have done using codeigniter also i get the same error.

        An error occurred
        Page not found
        Exception information:

        Message: Invalid controller specified (lankahomes)
        Stack trace:

        #0 /home/ZendFramework-1.12.3/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
        #1 /home/ZendFramework-1.12.3/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
        #2 /home/ZendFramework-1.12.3/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
        #3 /var/www/html/ZendApp/public/index.php(26): Zend_Application->run()
        #4 {main}  

        Request Parameters:

        array (
          'controller' => 'lankahomes',
          'action' => 'index',
          'module' => 'default',
        )  

can someone help me to fix this problem. Tnx

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duannai1883 2015-04-28 14:55
    已采纳

    It's about your apache configuration ( i assume you use apache cause it's in digital ocean documentation )

    <VirtualHost *:80>
        ServerName localhost
        DocumentRoot /var/www/ZendApp/public
    

    with this configuration, your localhost domain is only working for your zend project. Change it's ServerName to another domain and add it to your /etc/hosts file like

    /etc/apache2/sites-enabled/000-default

    <VirtualHost *:80>
          ServerName zendproject.dev
          DocumentRoot /var/www/ZendApp/public
    

    /etc/hosts

    127.0.0.1 zendproject.dev
    

    And restart your apache server. Then you can use zendproject.dev domain for your zend app and localhost for your default localhost directory. ( and i assume you have another apache vhosts conf file for localhost )

    已采纳该答案
    打赏 评论

相关推荐 更多相似问题