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 )

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!