对于一些访问没有明显错误提示的php页面,我们可以通过error_log来做进一步的判定。但出于种种原因,有些服务器并没有开启PHP的error_log功能。可以暂时开一下:

编辑php.ini,将log_errors设置为on:
log_errors = On
然后重启apache即可。

如成功开启,就可以跟踪到对应的错误提示:
[Mon Sep 24 16:57:01 2012] [error] [client 218.5.80.210] PHP Warning: fsockopen() has been disabled for security reasons in /home/piaoyun.cc/fsockopen.php on line 2
[Mon Sep 24 16:57:02 2012] [error] [client 218.5.80.210] PHP Warning: fsockopen() has been disabled for security reasons in /home/piaoyun.cc/fsockopen.php on line 2
[Mon Sep 24 16:57:03 2012] [error] [client 218.5.80.210] PHP Warning: fsockopen() has been disabled for security reasons in /home/piaoyun.cc/fsockopen.php on line 2
[Mon Sep 24 16:57:04 2012] [error] [client 218.5.80.210] PHP Warning: fsockopen() has been disabled for security reasons in /home/piaoyun.cc/fsockopen.php on line

如果是Windows环境,除了将log_errors设置为on外,还需要定义error_log的路径及文件名:
error_log = d:/temp/error.log
(此目录需要授予php标识用户的修改权限,否则日志文件无法生成)
因为IIS没有error_log的概念,需要另外定义。

暂无评论