I use WAMP, and in my php.ini file I have:
error_log = "d:/php_error.log"
When I open that file, I see:
[26-Jun-2013 05:35:57 UTC] PHP Warning: Division by zero in D:\....
[26-Jun-2013 05:35:57 UTC] PHP Stack trace:
[26-Jun-2013 05:35:57 UTC] PHP 1. {main}() D:\....
[26-Jun-2013 05:35:57 UTC] PHP 2. Zend_Application->run()...
etc
The problem is that there are extra Carriage returns. I.e. I am expecting to rather have this:
[26-Jun-2013 05:35:57 UTC] PHP Warning: Division by zero in D:\....
[26-Jun-2013 05:35:57 UTC] PHP Stack trace:
[26-Jun-2013 05:35:57 UTC] PHP 1. {main}() D:\....
[26-Jun-2013 05:35:57 UTC] PHP 2. Zend_Application->run()...
etc
What could be causing this?
UPDATE
I changed "error_append_string" and "error_prepend_string" to "". I also checked and the entries after a line are:
[LINE]CR
CRLF
[LINE]CR
etc
I.e. Carriage Returns and LineFeed symbols...
This might have something to do with syslog messing you up. So PHP adds the CR
, and then Windows' syslog goes in and puts an extra CRLF
in it when processing the log "line\n"
request.
See these related questions, where users had other problems with new line & error_log under other operating systems:
PHP error_log outputting line breaks as literal "\n" strings on Mac OSX
PHP error log and newline chars
In particular, this may happen when the user that Apache runs as does not have permission to write to the file, or the error_log
directive in your php.ini is unset (or defined as syslog
). More details here: http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-log
As for the log file itself, you may try to experiment with it by giving it 777 permission, or creating the file yourself instead of letting the system create it (or vice-versa). Some users report different problems/solutions with each of these tweaks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With