【发布时间】:2011-06-19 05:15:31
【问题描述】:
我们的网站在加载/重新加载页面时在 FireFox 中间歇性崩溃。该站点使用 Zend Framework 1.11.7 构建。问题出在我们的生产服务器(共享主机)上,它似乎只在使用 FireFox 时发生,所有其他浏览器我们都无法复制该问题。开发服务器工作正常。该网站已经过验证,但我们使用的 Adobe Strobe Media Player 会出现常见的验证错误。
当它崩溃时我们通常会看到
请联系服务器管理员,[未提供地址],并告知他们 > 错误发生的时间,以及您可能所做的任何可能导致错误的事情。
服务器错误日志中可能会提供有关此错误的更多信息。
0 HTTP/1.1 200 OK 日期:2011 年 6 月 19 日星期日 04:33:13 GMT 服务器:Apache/2.2.17 (Unix) > > >FrontPage/5.0.2.2635 X-Powered-By:PHP/5.2。 17 Keep-Alive: timeout=5, max=99 Connection: Keep->Alive Transfer-Encoding: chunked Content-Type: text/html 38fd
上面的消息可以在正文中,也可以是正文中的唯一内容以及 html 源代码。我们还看到上面的消息替换了 Javascript/jQuery 代码。
有时网站会在没有 CSS 的情况下加载,有时则没有 Javascript (jQuery)。
我们的服务器日志中没有错误。
从症状看来,bootstrap.php 文件没有正确加载。
我们使用的是默认的.htaccess,而我们的bootstrap.php是
<?php
类 Bootstrap 扩展 Zend_Application_Bootstrap_Bootstrap {
protected function _initView() {
$view = new Zend_View();
$view->doctype('XHTML1_TRANSITIONAL');
$view->headTitle(' News')
->setSeparator(' - ');
$view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=utf-8');
$view->headLink(array('rel' => 'shortcut icon',
'href' => '/css/images/favicon.ico'), 'PREPEND');
$view->headScript()->appendFile('/js/jquery-1.6.1.min.js')
->appendFile('/js/jquery-ui-1.8.13.custom.min.js')
->appendFile('/js/validate.js')
->appendFile('/js/bloom.js');
$view->headLink()->appendStylesheet('/css/main.css')
->appendStylesheet('/css/trontastic/jquery-ui-1.8.13.custom.css');
// Add it to the ViewRenderer
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view);
// Return it, so that it can be stored by the bootstrap
return $view;
}
protected function _initAutoload() {
// Add autoloader empty namespace
$autoLoader = Zend_Loader_Autoloader::getInstance();
$autoLoader->registerNamespace('BloomData_');
$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
'basePath' => APPLICATION_PATH,
'namespace' => '',
'resourceTypes' => array(
'form' => array(
'path' => 'forms/',
'namespace' => 'Form_',
),
'model' => array(
'path' => 'models/',
'namespace' => 'Model_'
),
),
));
// Return it so that it can be stored by the bootstrap
return $autoLoader;
}
protected function _initRoute() {
$ctrl = Zend_Controller_Front::getInstance();
$router = $ctrl->getRouter(); // returns a rewrite router by default
$ir = new Zend_Controller_Router_Route_Regex('id/(.*)',
array('controller' => 'index', 'action' => 'index'),
array(1 => 'id'));
$router->addRoute('idRoute', $ir);
$sr = new Zend_Controller_Router_Route_Regex('sector/(.*)/id/(.*)',
array('controller' => 'index', 'action' => 'index'),
array(1 => 'sector', 2 => 'id'));
$router->addRoute('sectorRoute', $sr);
$dr = new Zend_Controller_Router_Route_Regex('date/(.*)/id/(.*)',
array('controller' => 'index', 'action' => 'index'),
array(1 => 'date', 2 => 'id'));
$router->addRoute('dateRoute', $dr);
}
}
【问题讨论】:
-
你用的是哪个FF版本?
标签: zend-framework