php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23658 still problem with fwrite() , fputs()
Submitted: 2003-05-16 05:01 UTC Modified: 2003-05-26 09:43 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: c dot ferrari at gmx dot net Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.2RC3 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: c dot ferrari at gmx dot net
New email:
PHP Version: OS:

 

 [2003-05-16 05:01 UTC] c dot ferrari at gmx dot net
This is a sirious problem!
Since Version 4.3.1 an above fputs() does not work as expectet.
Try out the example above.

Example:
<?php
$text="";
$text .= "11111"."\n";
$text .= "22222"."\n";
$text .= "33333"."\n";
$text .= "44444"."\n";
$text .= "55555"."\n";
$text .= "66666"."\n";
$text .= "77777"."\n";
$text .= "88888"."\n";
$text .= "99999"."\n";
$text .= "91111"."\n";

	$fp=fopen("./log.txt","w+");
 	fputs($fp,$text."\n");
 	fputs($fp,"\n*");
 	fclose($fp);
?>

My output looks like this:

11111
22222
33333
44444
55555
66666
77777
88888
99999
*1111

--------------------------------------------------------

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-16 09:46 UTC] sniper@php.net
Works fine within linux, so it's just some win32 problem.

 [2003-05-16 10:31 UTC] wez@php.net
How are you producing that output?
 [2003-05-16 14:25 UTC] pollita@php.net
*not* confirmed on Win2K/4.3.2RC3.

The above example works exactly as expected.

type log.txt

Outputs:

11111
22222
33333
44444
55555
66666
77777
88888
99999
91111


*



Is it possible some of your \n characters are typoed as \r ?
 [2003-05-22 16:40 UTC] sniper@php.net
Can not reproduce either.

 [2003-05-26 09:43 UTC] c dot ferrari at gmx dot net
It was a problem with my webserver (sambar5.3). The new Version of this server has fixt this problem.
Thanx
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 14:01:33 2025 UTC