我在运行CPANEL的专用服务器上运行了一个网站。 我有Apache / 2.4.12和PHP版本5.4.41。
有一段时间我在日志中看到错误500响应。但我似乎无法弄清楚它的来源。当我检查页面时...它很好,并抛出200响应代码。当我尝试在谷歌中获取它时,它也没关系。但有时候,Google网站管理员会报告我在某些网页上收到了错误500.
这里的任何人都经过了正确的调试吗?什么可能触发错误?
日志示例:
46.229.168.79 - - [16/Mar/2018:09:45:04 -0400] "GET /sports-nfl-larry-allen-weight HTTP/1.1" 500 6935 "-" "Mozilla/5.0 (compatible; SemrushBot/1.2~bl; +http://www.semrush.com/bot.html)"
148.64.56.65 - - [16/Mar/2018:09:45:09 -0400] "GET /snap-meee HTTP/1.1" 500 6711 "-" "Mozilla/5.0 (compatible; GrapeshotCrawler/2.0; +http://www.grapeshot.co.uk/crawler.php)"
23.96.208.137 - - [16/Mar/2018:11:30:05 -0400] "GET /rihanna-slams-snapchat HTTP/1.1" 500 7462 "-" "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)"
72.30.14.91 - - [16/Mar/2018:11:30:07 -0400] "HEAD /kendall-jenner-explained-to-ellen-degeneres HTTP/1.1" 500 - "-" "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
只是为了添加更多信息。我得到了APC缓存,我使用了CDN提供商。但就像我说的那样,当我检查它时,页面实际上响应非常快,没有错误。
编辑:错误日志中的内容..但是当发生错误500时,我没有看到与时间戳对应的任何日志。
[Thu Mar 15 17:12:44.532038 2018] [core:error] [pid 26532] [client 194.0.200.11:52727] AH00135: Invalid method in request ------41184676334--
[Thu Mar 15 17:13:01.113257 2018] [core:error] [pid 26538] [client 194.0.200.11:54514] AH00135: Invalid method in request ------41184676334--
[Thu Mar 15 20:10:44.220358 2018] [core:notice] [pid 17916] AH00052: child pid 8905 exit signal Segmentation fault (11)
[Fri Mar 16 05:35:21.280659 2018] [core:error] [pid 25310] [client 71.6.146.185:57523] AH00135: Invalid method in request quit
[Fri Mar 16 08:25:10.126197 2018] [:error] [pid 6358] [client 66.249.69.147:43415] script '/home/****/public_html/index.php' not found or unable to stat
[Fri Mar 16 12:25:22.897389 2018] [mpm_prefork:notice] [pid 17916] AH00173: SIGHUP received. Attempting to restart
[Fri Mar 16 12:25:22.950624 2018] [mpm_prefork:warn] [pid 17916] AH00181: MaxRequestWorkers of 400 exceeds ServerLimit value of 256, decreasing to match
[Fri Mar 16 12:25:23.001101 2018] [ssl:warn] [pid 17916] AH01909: proxy-subdomains-ssl-default-vhost.localhost:443:0 server certificate does NOT include an ID which matches the server name
[Fri Mar 16 12:25:23.138917 2018] [mpm_prefork:notice] [pid 17916] AH00163: Apache/2.4.12 (Unix) OpenSSL/1.0.1e-fips PHP/5.4.41 configured -- resuming normal operations
[Fri Mar 16 12:25:23.138948 2018] [core:notice] [pid 17916] AH00094: Command line: '/usr/local/apache/bin/httpd'
我正在修复MaxRequestWorkers警告,我认为该错误与错误500无关。
答案 0 :(得分:0)
好吧终于!!!我将error_reporting更改为...
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
现在我在页面上看到了错误
Invalid argument supplied for foreach()
出于某种原因......当我手动检查并且错误报告最初设置为E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR
时,网站呈现正常并返回200响应这个bug让我付出了很多代价。我一直想知道为什么我的部分网页已从Google搜索中删除。现在我知道为什么......
感谢。