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 )

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

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算