|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52141 little problem
Submitted: 2010-06-22 12:05 UTC Modified: 2010-06-27 22:00 UTC
From: haheute at googlemail dot com Assigned: wiesemann (profile)
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: ubuntu
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: haheute at googlemail dot com
New email:
PHP Version: OS:


 [2010-06-22 12:05 UTC] haheute at googlemail dot com
Beispiel #1 Ein einfaches Beispiel für fwrite:

does not work, because is_writeable is before fopen

i had to change to:

1. fopen and than:
2. is_writeable and
3. fwrite

otherwise an error occurs, saying file xy is not writeable


Test script:
this works on my webspace (already changed from the

      $filename = "upload_anonym/" . $name.".txt"; 
      if (!$handle = fopen($filename, "w")){
		  print "Kann die Datei $filename nicht öffnen";
	  if (is_writable($filename)) {
	  if (!fwrite($handle, $bildtext)) {
          print "Kann in die Datei $filename nicht schreiben";
      print "<span style=\"background-color:#ad8; font-size:0.9em;\">Bildtexte gespeichert in: ".$filename."</span>";
      print "Die Datei $filename ist nicht beschreibbar.";

Expected result:
text file containing a picture description

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-27 22:00 UTC]
-Status: Open +Status: Bogus -Package: Website problem +Package: Documentation problem -Assigned To: +Assigned To: wiesemann
 [2010-06-27 22:00 UTC]
The example shows how to append ('a' mode in fopen() call) something to a file. This requires that the file exists and that the file is writable. I.e. the example assumes that test.txt has already been created (=> this is outside of the scope of the example).
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 24 07:03:37 2021 UTC