开发者社区> 问答> 正文

apache日志报错PHPNoticeUndefinedindexHTTPHOS

[Fri Jan 03 11:42:39 2014] [notice] Apache/2.2.25 (Win32) PHP/5.3.5 configured -- resuming normal operations
[Fri Jan 03 11:42:39 2014] [notice] Server built: Jul 10 2013 01:52:12
[Fri Jan 03 11:42:39 2014] [notice] Parent: Created child process 1320
[Fri Jan 03 11:42:39 2014] [notice] Child 1320: Child process is running
[Fri Jan 03 11:42:39 2014] [notice] Child 1320: Acquired the start mutex.
[Fri Jan 03 11:42:39 2014] [notice] Child 1320: Starting 64 worker threads.
[Fri Jan 03 11:42:39 2014] [notice] Child 1320: Starting thread to listen on port 80.
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.126.208] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 24
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.126.208] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 25
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.126.208] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 25
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.126.208] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 26
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.126.208] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 27
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.127.78] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 24
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.127.78] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 25
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.127.78] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 25
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.127.78] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 26
[Fri Jan 03 11:42:39 2014] [error] [client 10.159.127.78] PHP Notice:  Undefined index: HTTP_HOST in D:\\wwwroot\\index.php on line 27

装的discuz x3.1 现在apache日志那里报错如上,24、25、26、27行报错在不断,一天生成日志1个G那么多!怎么解决呀!

展开
收起
我是驴友 2014-01-03 12:18:29 11252 0
5 条回答
写回答
取消 提交回答
  • 技术贴啊。。。
    2014-01-03 18:49:11
    赞同 展开评论 打赏
  • 估计你是设置了负载均衡或者WAF或者设置了其他前端,总之,APACHE不是直接接收HTTP请求,然后前端转发请求给APACHE时没有带HTTP_HOST这个值,然后在程序里引用$_SERVER['HTTP_HOST']时就报错了。

    最好说下你现在使用的环境,是什么在处理前端请求,才好给你建议。

    -------------------------

    Re:回5楼服务器之家的帖子
    引用第6楼我是驴友于2014-01-03 17:04发表的 回5楼服务器之家的帖子 :
    谢谢!

    是用了负载均衡出现这个错误的。

    服务器环境win2003 Apache/2.2.25 (Win32)  PHP/5.3.5
    .......

    新建一个test.php,写入下面的内容
    <?php
    echo '<pre>';
    print_r('$_SERVER');
    echo '</pre>';

    访问后把内容帖出来。

    另外SLB里可以设置TCP和HTTP协议,不知道你现在用的是哪个,更换下试试。

    -------------------------

    有点错误,重试下。

    <?php

    echo '<pre>';
    print_r($_SERVER);
    echo '</pre>';

    -------------------------

    帖子有敏感信息,删除了。测试程序里有HTTP_HOST,但是论坛里没有,很奇怪。

    2014-01-03 17:00:29
    赞同 展开评论 打赏
  • http://www.discuz.net/thread-3501170-1-1.html 这个应该是你的dz发的帖子 这个还是等待dz来解决吧
    2014-01-03 16:26:19
    赞同 展开评论 打赏
  • 分享阿里云支持与服务团队最佳实践、经典案例与故障排查。
    回 楼主(我是驴友) 的帖子
    lz别急,正在看,有结果马上回复亲~

    -------------------------

    回 楼主(我是驴友) 的帖子
    lz好,和您进行了电话沟通,这是一个报警信息,不会影响您的使用,请亲放心!
    2014-01-03 16:26:09
    赞同 展开评论 打赏
  • Reapache日志报错PHPNoticeUndefinedindexHTTPHOS
    没人吗

    -------------------------

    回5楼服务器之家的帖子
    谢谢!

    是用了负载均衡出现这个错误的。

    服务器环境win2003 Apache/2.2.25 (Win32)  PHP/5.3.5

    -------------------------

    回4楼cloudservice的帖子
    谢谢!

    -------------------------

    回3楼pxw2002的帖子
    是的,谢谢!

    -------------------------

    回9楼服务器之家的帖子
    $_SERVER

    显示的是这个

    -------------------------

    回13楼服务器之家的帖子
    还是很感谢你乐意帮助。

    -------------------------

    Reapache日志报错PHPNoticeUndefinedindexHTTPHOS
    [Sat Jan 04 00:24:52 2014] [notice] Apache/2.2.25 (Win32) PHP/5.3.5 configured -- resuming normal operations
    [Sat Jan 04 00:24:52 2014] [notice] Server built: Jul 10 2013 01:52:12
    [Sat Jan 04 00:24:52 2014] [notice] Parent: Created child process 3976
    [Sat Jan 04 00:24:52 2014] [notice] Child 3976: Child process is running
    [Sat Jan 04 00:24:52 2014] [notice] Child 3976: Acquired the start mutex.
    [Sat Jan 04 00:24:52 2014] [notice] Child 3976: Starting 64 worker threads.
    [Sat Jan 04 00:24:52 2014] [notice] Child 3976: Starting thread to listen on port 80.
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.88] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 24
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.88] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 25
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.88] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 25
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.88] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 26
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.88] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 27
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.126.230] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 24
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.126.230] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 25
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.126.230] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 25
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.126.230] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 26
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.126.230] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 27
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.179] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 24
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.179] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 25
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.179] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 25
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.179] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 26
    [Sat Jan 04 00:24:57 2014] [error] [client 10.159.127.179] PHP Notice:  Undefined index: HTTP_X_FORWARDED_HOST in D:\\wwwroot\\index.php on line 27
    2014-01-03 16:11:45
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
PostgresChina2018_赖思超_PostgreSQL10_hash索引的WAL日志修改版final 立即下载
Kubernetes下日志实时采集、存储与计算实践 立即下载
日志数据采集与分析对接 立即下载

相关镜像