【问题标题】:Exception when trying to migrate zend files to local host尝试将 zend 文件迁移到本地主机时出现异常
【发布时间】:2013-08-07 02:54:02
【问题描述】:

我正在尝试将 php zend 文件从服务器运行到本地主机(迁移)。我已经更改了我知道的配置,但是当我尝试运行它时,浏览器中显示以下错误;

Array ( [0] => Zend_Controller_Dispatcher_Exception Object 
   ( 
   [message:protected] => Invalid controller specified (www) 
   [string:Exception:private] => [code:protected] => 0 
   [file:protected] => C:\xampp\htdocs\www\html\library\Zend\Controller\Dispatcher\Standard.php 
   [line:protected] => 241 
   [trace:Exception:private] => Array ( 
         [0] => Array ( 
            [file] => C:\xampp\htdocs\www\html\library\Zend\Controller\Front.php 
            [line] => 936 
            [function] => dispatch 
            [class] => Zend_Controller_Dispatcher_Standard 
            [type] => -> [args] => Array ( 
                 [0] => Zend_Controller_Request_Http Object ( 
                     [_paramSources:protected] => Array ( 
                         [0] => _GET [1] => _POST ) 
                         [_requestUri:protected] => /www/html/web/ 
                         [_baseUrl:protected] => 
                         [_basePath:protected] => 
                         [_pathInfo:protected] => /www/html/web/ 
                         [_params:protected] => Array ( 
                             [controller] => www 
                             [action] => html 
                             [module] => default 
                             )
                         [_aliases:protected] => Array ( ) 
                         [_dispatched:protected] => 1 
                         [_module:protected] => default 
                         [_moduleKey:protected] => module 
                         [_controller:protected] => www 
                         [_controllerKey:protected] => controller 
                         [_action:protected] => html 
                         [_actionKey:protected] => action 
                     ) 
                 [1] => Zend_Controller_Response_Http Object ( 
                     [_body:protected] => Array ( ) 
                     [_exceptions:protected] => Array RECURSION 
                     [_headers:protected] => Array ( ) 
                     [_headersRaw:protected] => Array ( ) 
                     [_httpResponseCode:protected] => 200 
                     [_isRedirect:protected] => 
                     [_renderExceptions:protected] => 
                   [headersSentThrowsException] => 1 
                 )
            )
       ) 
       [1] => Array ( 
           [file] => C:\xampp\htdocs\www\html\index.php 
           [line] => 5 
           [function] => dispatch 
           [class] => Zend_Controller_Front 
           [type] => -> 
           [args] => Array ( ) 
       )
   )
   [previous:Exception:private] => 
)
)

你们能帮我解决这个错误吗?提前致谢

【问题讨论】:

  • 如果你从windows迁移到linux系统的话可能会是个问题。确保您调用控制器的情况与定义的情况相同。
  • 你检查过php错误日志吗?这可能更有用。
  • @RiggsFolly 异常说明了在这种情况下错误日志必须说明的内容
  • 这是从 windows 到 windows,只是从以前的开发人员到我。我需要在本地运行它来更改文件。
  • 您是否在此文件 windows/system32/drivers/etc/hosts 中进行了任何更改

标签: php arrays zend-framework exception localhost


【解决方案1】:

在该文件末尾添加以下行

Host iplocalsite url

例如

127.192.220.12zend.local

我不确定这是最终的解决方案。但它可能会对您有所帮助!

【讨论】:

  • 它不工作。我刚刚得知这个系统是在linux上开发的。我想将它迁移到 Windows。我需要做出哪些改变?
  • 或者您可以在 application.ini 文件的 [production] 部分编写以下行:resources.frontController.params.useDefaultControllerAlways = 1
  • 它不会改变任何东西。我读过这个错误是由于文件夹中不存在控制器引起的。我拿了这个文件,不对控制器部分做任何更改。如果它在 linux 服务器上工作,我只是不知道为什么它不能在 Windows localhost 上工作。然后回到互联网..
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-02-02
  • 2020-06-08
  • 2017-12-20
  • 2021-12-25
  • 1970-01-01
  • 1970-01-01
  • 2020-08-30
相关资源
最近更新 更多