On Friday 14 February 2003 16:36, Dunkel wrote: > How do I ensure that all file access permissions are allowed? What is > the proper way to do it? > > - I tried to 'fopen' an existing text file but got "Permission denied" > error. > - I tried different parameters, same error > - I tried to use 'chmode', same thing > > Same thing with different servers so I'm obviously doing something > wrong. Everything else works fine but the writing doesn't. > > The (writing)code is very basic > (the textfile.txt exists before this): > > <?php > > $filename = "textfile.txt"; > $somecontent = "the text to add\n"; > $handle = fopen($filename, 'a+w'); > fwrite($handle, $somecontent); > fclose($handle); > > ?> > > So, what should I do to get it work?
Try using the /fullpath/to/the/file. If you're in doubt about the permissions try writing to the system temp directory (/tmp for example). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Whatever occurs from love is always beyond good and evil. -- Friedrich Nietzsche */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php