#25293 [NEW]: Error Reporting to file outputs wrong Windows Newline format
| From: | duerra at yahoo dot com | Date: | Thu, 28 Aug 2003 14:21:17 +0000 |
| Subject: | #25293 [NEW]: Error Reporting to file outputs wrong Windows Newline format | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-46846@lists.php.net to get a copy of this message | ||
From: duerra at yahoo dot com
Operating system: Windows 2000
PHP version: 4.3.3
PHP Bug Type: *General Issues
Bug description: Error Reporting to file outputs wrong Windows Newline format
Description:
------------
When you turn error reporting on in php and set errors to output to a
file:
error_log = phperrors.txt
When there's a syntax error, php outputs the wrong newline format for
windows (\r\n) to the file, effectively causing all errors in php to
appear on a single line in the text file - with a little rectangle
(unknown character?) where the newline is supposed to be.
In tests, using "\n" alone instead of "\r\n" in Windows when writing to a
file will cause this to happen.
Reproduce code:
---------------
<?php
echo "Syntax error here... no semicolon"
//When this is run repeatedly, each error should appear on a new line, but
only appears on one line in the .txt file because of the newline format
?>
Expected result:
----------------
[28-Aug-2003 09:17:51] PHP Parse error: parse error, unexpected '}' in
C:\Documents and Settings\i1add01\Desktop\php\php-4.3.3-Win32\run.php on
line 13
[28-Aug-2003 09:18:05] PHP Parse error: parse error, unexpected '}' in
C:\Documents and Settings\i1add01\Desktop\php\php-4.3.3-Win32\run.php on
line 13
Actual result:
--------------
[28-Aug-2003 09:17:51] PHP Parse error: parse error, unexpected '}' in
C:\Documents and Settings\i1add01\Desktop\php\php-4.3.3-Win32\run.php on
line 13(newline without carriage return here)[28-Aug-2003 09:18:05] PHP
Parse error: parse error, unexpected '}' in C:\Documents and
Settings\i1add01\Desktop\php\php-4.3.3-Win32\run.php on line 13
--
Edit bug report at http://bugs.php.net/?id=25293&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25293&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25293&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25293&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25293&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25293&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25293&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25293&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25293&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25293&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25293&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25293&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25293&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25293&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25293&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25293&r=gnused