地址:
http://kn007.net/ip.php
打开错误显示:
error_reporting("E_ALL");
ini_set("display_errors", 1);
返回200,没有任何错误回显,不过有notice:
PHP Notice: Undefined index: ip in ~WWW/kn007.net/ip.php on line 9
Line 9: $ip=$_POST['ip'];
我仔细检查了一遍,完全没问题,权限正常,编码正常。
php、nginx的log正常。
1
kn007 OP 直接命令行,返回
root@kn007:~WWW/kn007.net > php ip.php |grep PHP PHP Notice: Undefined index: ip in ip.php on line 9 PHP Notice: Undefined variable: ip in ip.php on line 94 PHP Notice: Undefined index: ip in ip.php on line 214 PHP Notice: Undefined variable: ipdata in ip.php on line 245 PHP Notice: Trying to get property of non-object in ip.php on line 245 PHP Notice: Undefined variable: ipdata in ip.php on line 245 PHP Notice: Trying to get property of non-object in ip.php on line 245 PHP Notice: Undefined variable: ipdata in ip.php on line 245 PHP Notice: Trying to get property of non-object in ip.php on line 245 PHP Notice: Undefined variable: ipdata in ip.php on line 245 PHP Notice: Trying to get property of non-object in ip.php on line 245 PHP Notice: Undefined variable: ipdata in ip.php on line 245 PHP Notice: Trying to get property of non-object in ip.php on line 245 PHP Notice: Undefined variable: otheripdata in ip.php on line 245 |
2
abelyao 2015-03-28 23:44:49 +08:00 1
话说我打开没问题…
|
3
fu82581983 2015-03-28 23:44:58 +08:00 1
应该是PHP Notice: Trying to get property of non-object in ip.php on line 245引起的,确保对象实例化正确。
|
4
gongpeione 2015-03-28 23:46:28 +08:00 1
if(!empty($_POST['ip']))
$ip=$_POST['ip']; 这样? |
5
em70 2015-03-28 23:47:17 +08:00 via Android 1
你的php配置文件关闭了显示错误提示,但又出现异常就会500错误,可以把错误提示打开,调通了再改回去
|
7
kn007 OP @fu82581983 命令行就会,直接线上是没问题的。应该不是这个问题。另外500是Fatal Error才会引起的
|
8
kn007 OP @gongpeione 我改过了,没用。。。php不需要如此严谨的模式
|
10
ETiV 2015-03-28 23:58:30 +08:00 1
|
12
gongpeione 2015-03-29 00:03:20 +08:00 1
引用了未定义的变量然后又关了错误显示是返回500的 _(:з」∠)_
|
13
kn007 OP @gongpeione 找到原因了。。。晕死。
Memcached没有close传递。 PHP Fatal error: Call to undefined method Memcached::close() in ~WWW/kn007.net/ip.php on line 299 |
14
kn007 OP 已解决,谢谢各位 @ETiV @abelyao @em70 @fu82581983 @gongpeione
错误原因: PHP Fatal error: Call to undefined method Memcached::close() in ~WWW/kn007.net/ip.php on line 299 Memcached没有close传递。利用 ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); 得到的。。。太囧了。网页居然都没错误,命令行也没错误。必须输出到txt才会显示这个Fatal error |
15
ETiV 2015-03-29 01:49:13 +08:00
哦对. 我记起来了...
display_error 设定不会输出到 html, 还一个 把error 输出到 html 的设定需要打开才能看得见. |