php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25293 Error Reporting to file outputs wrong Windows Newline format
Submitted: 2003-08-28 09:21 UTC Modified: 2003-09-24 19:20 UTC
From: duerra at yahoo dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.3.3 OS: Windows 2000
Private report: No CVE-ID: None
 [2003-08-28 09:21 UTC] duerra at yahoo dot com
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-24 19:20 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2004-03-17 01:25 UTC] geoffreylai at msn dot com
If this parse error do occur on my computer, is there a way which I could resolve this problem?

The error pop ups everytime I turn on my computer and whenever I click on to "the Control Panel".

Thank you for your assistance.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 12 06:01:27 2024 UTC