php - 无法访问cpanel,获取 “HTTP ERROR 500”

标签 php regex error-handling phpmyadmin server

由于某种原因,我无法再访问HostPapa cpanel,这是说:

The www.hostpapa.ca page isn’t working
www.hostpapa.ca is currently unable to handle this request.
HTTP ERROR 500

我检查了错误日志,并看到在不同的日期/时间重复了此相同的错误:
[07-Jun-2016 14:30:26 America/Toronto] PHP Notice:  Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160
[07-Jun-2016 19:26:50 America/Toronto] PHP Notice:  Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160
[08-Jun-2016 08:45:14 America/Toronto] PHP Notice:  Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160
[08-Jun-2016 20:35:00 America/Toronto] PHP Notice:  Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160
[08-Jun-2016 23:14:13 America/Toronto] PHP Notice:  Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160

我检查了文件,第1160行是:
if(isset($r[2]) && @$r[2] == 'img' && preg_match('/MSIE [5-7]/',$_SERVER['HTTP_USER_AGENT']) == 0) {

对我来说这看起来像胡言乱语,所以我不确定该怎么做。昨天,我的搭档使我成为该网站的“ super 管理员”-不确定它是否可能与此相关?或为什么会这样。

如果有人能指出我正确的方向,我将非常感激。

谢谢

最佳答案

用户代理 header 是可选 header 。可能正在过滤某些内容(例如防火墙),或者人们可以将其客户端配置为忽略 header 。

您可能要检查 header 是否存在isset()

关于php - 无法访问cpanel,获取 “HTTP ERROR 500”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37728704/

相关文章:

php - 通知 : Undefined variable: _SESSION in "" on line 9

PHP 包含 : Losing UTF-8 characters on included code

PHP 回显日期作为字符串

regex - 排除整个单词并强制执行惰性正则表达式行为

javascript - Regex Javascript 如何从 PHP Regex 模仿负向后查找

Python正则表达式通过查看后面的数字

PHP 错误记录。如何预防?

php - Symfony2 日期时间查询生成器

php 新的 dateTime 和 gmdate

python - 从异常中捕获有关已执行代码行的信息