2012-05-22 31 views
0

我有点过时的托管公司。我有一个PHP/Apache安装程序。PHP和Apache - 我该如何阻止写入日志的东西太多

由于某些原因,它不断写入日志文件。有两个日志文件:

访问日志和

是error_log

我从来没有考虑访问日志,那么有没有可以打开或关闭该打开将停止所有写入访问日志一些Apache的配置?

而对于error_log,我在那里非常随机地得到很多东西。

[Sun May 20 00:56:28 2012] [error] [client 92.96.145.124] PHP Notice: Undefined index: photo_path in /home/webadmin/problemio.com/html/utils/api/somefile.php on line 398 
[Sun May 20 00:56:28 2012] [error] [client 92.96.145.124] PHP Notice: Undefined index: photo_path in /home/webadmin/problemio.com/html/utils/api/somefile.php on line 398 

但这些都是通知。我怎么才能让它显示警告和错误?

谢谢!

+0

以下是有关日志文件的Apache文档:http://httpd.apache.org/docs/logs.html – icktoofay

回答

1

在页面/页眉的顶部加入这两个中的一个,这应该注意通知(根据你想看到的内容)。

// Turn off all error reporting 
error_reporting(0); 

// Report simple running errors 
error_reporting(E_ERROR | E_WARNING | E_PARSE); 
+0

谢谢!这非常有帮助。但是在设置/配置中有没有办法做到这一点? – GeekedOut

+0

你的php.ini文件中应该有一个错误报告字段,适用的值全部列在这里:http://www.php.net/manual/en/errorfunc.constants.php – fergusonkw

1

我曾经面对同样的问题。我向CS询问了这一点,他们只是回答“不能”。我最终编写了一个cron脚本来删除这些垃圾文件。

+0

听起来很糟糕:)其实我认为需要大量资源将这些内容写入文件系统我真的需要它不会发生。 – GeekedOut

1

这个变量是在使用时不/home/webadmin/problemio.com/html/utils/api/somefile.php上线限定

photo_path 398

你需要找到该文件。发现错误。

相关问题