note 1483 deleted from fopen by ronabop

From: Date: Sat, 19 Aug 2000 03:43:03 +0000
Subject: note 1483 deleted from fopen by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-2608@lists.php.net to get a copy of this message
About fopen (... "w") (for beginners, by a beginner): Creating files with fopen(... "w") does not work unless the http- server has write permission to the directory where the file is to be located. You can give the http-server this permission with the command: "chmod o+w mydir/" (assuming your directory is called mydir/). The command gives everybody permission to add and remove files in the directory. When a file is created by php (fopen), php will have no problems to later open it for write. If you create the file yourself, and want to let php (as http-server) open it for write with fopen(... "w"), then you must first give the http-server permission to open the file for write. This can be done with the command: "chmod o+w myfile" (assuming your file is called myfile). The command gives everybody permission to write to the file. Both these examples assume a Unix server (for example Linux) and that you have access to the server either directly or through telnet. If you only have FTP access to the server, I really do not know if it is possible to use PHP to write into files. Is there a better way to do this, anybody?

« previous php.notes (#2608) next »