PHP通过CLI成功将错误记录到/var/log/php_errors.log.
但是apache + php不会记录错误.
[bla@notebook ~]$ apachectl -v
Server version: Apache/2.2.17 (Unix)
Server built: May 19 2011 03:15:39
[bla@notebook ~]$ php -v
PHP 5.3.6 with Suhosin-Patch (cli) (built: Mar 23 2011 13:28:00)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
Run Code Online (Sandbox Code Playgroud)
在php.ini我有:
display_errors = On
error_reporting = E_ALL | E_STRICT
log_errors = On
error_log = php_errors.log
Run Code Online (Sandbox Code Playgroud)
在httpd.conf中:
ErrorLog "/var/log/httpd/error_log"
Run Code Online (Sandbox Code Playgroud)
权限:
[bla@notebook /]$ ls -la /var/log/httpd/
-rwxrwxr-x 1 root root 133351 21.11.2011 …Run Code Online (Sandbox Code Playgroud) 有没有办法测量一个Apache日志文件中使用了多少流量?
格式:
66.249.72.214 - - [05/Nov/2011:12:47:37 +0200] "GET /produktas/565638 HTTP/1.1" 200 4699 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
Run Code Online (Sandbox Code Playgroud)
我理解的4699是除了标题之外传输的字节.
我需要一个简单的解决方案(可能是一个小的bash脚本)来汇总每个日志行中的字节.