第一次访问页面时,神秘数字出现在Drupal生成的HTML上方 [英] Mysterious number appears above Drupal-generated HTML when visiting page for first time

查看:145
本文介绍了第一次访问页面时,神秘数字出现在Drupal生成的HTML上方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Drupal网站上的许多页面上,在第一次访问(编辑)任何浏览器页面时,HTML上方(编辑:及以下)显示一个神秘的数字。在IE7和IE8中,问题页面渲染不正确,但在其他浏览器中,页面的其余部分呈现没有问题。刷新后,数字通常会消失。我的用户告诉我,每天早上都会再次出现错误,虽然我看过一个用户刷新的情况,但奇怪的数字并没有消失。我对其他浏览器没有任何问题。

On a number of pages on my Drupal site a mysterious number appears above ( and below) the HTML the first time the page is visited in (EDIT) any browser. In IE7 and IE8 the problem pages are rendering incorrectly, but in the other browsers the rest of the page renders without problems. After a refresh the number usually disappears. My users tell me that the error occurs again each morning, although I've seen one case where a user refreshes and the strange number does NOT go away. I've had no problems with other browsers.

以下是HTML的前几行:

Here are the first few lines of HTML:

3535 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

..页面的其余部分正常生成,然后我在底部看到以下内容:

.. the rest of the page generates normally, and then I see the following at the bottom:

</html> 

0 

我很困惑 - apache日志或我的vhost error.log上都没有相关内容。我做了一个差异页面上的html与页数没有,除了顶部和底部的数字之外,唯一的区别是空格。

I'm baffled - nothing related appears on either apache logs or my vhost error.log. I've done a diff of the html on pages with the number versus pages without and apart from the numbers at top and bottom the only difference is whitespace.

我在Apache 2.2中运行Drupal 6.19在Ubuntu 7.04上.PHP版本是5.2。

I'm running Drupal 6.19 in Apache 2.2 on Ubuntu 7.04. PHP version is 5.2.

这里的参考是我的index.php - 我认为我们没有从标准中改变过任何东西。

For reference here's my index.php - I don't think there's anything that we've changed from the standard.

<?php
// $Id: index.php,v 1.94 2007/12/26 08:46:48 dries Exp $

/**
 * (Drupal copyright ommitted for brevity)
 */

require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

$return = menu_execute_active_handler();

// Menu status constants are integers; page content is a string.
if (is_int($return)) {
  switch ($return) {
    case MENU_NOT_FOUND:
      drupal_not_found();
      break;
    case MENU_ACCESS_DENIED:
      drupal_access_denied();
      break;
    case MENU_SITE_OFFLINE:
      drupal_site_offline();
      break;
  }
}
elseif (isset($return)) {
  // Print any value (including an empty string) except NULL or undefined:
  print theme('page', $return);
}

drupal_page_footer();


推荐答案

在花大量时间检查自己的代码之前,请分析涉及网络设置。

Before spending much time checking your own code, analyze the involved network setup.

我们在一年前有一个类似的现象代理服务器将数字插入到他转发的页面中。

We had a similar phenomenon about a year ago where a proxy server inserted numbers like that into the pages he relayed.

我不记得它是什么代理服务器的细节,以及他为什么这样做,但很明显,因为只有从某些网络访问该网站的人才会得到这些数字。

I do not remember the details about what proxy server it was, and why he did it, but it was pretty obvious, as only people accessing the site from certain networks would get these numbers.

编辑:我不是百分百肯定,但我认为这是此nginx反向代理问题这篇文章也可能是相关的。)

I'm not 100% sure, but I think it was this nginx reverse proxy issue (This post might be related as well.)

这篇关于第一次访问页面时,神秘数字出现在Drupal生成的HTML上方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆