RE: [PHP] Writing Files (Unix, Apache, PHP 4.0.X) [Newbie Alert]

From: Date: Sat, 01 Jun 2002 00:19:00 +0000
Subject: RE: [PHP] Writing Files (Unix, Apache, PHP 4.0.X) [Newbie Alert]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-100196@lists.php.net to get a copy of this message
Does the file already exist? It's not enough to change the directory permissions, you also have to change it on the file if it exists, and all of the folders above it, so that apache can get to the file. In order for PHP to open or create this file, the user that apache runs as must have permission to the folder and file. ---John Holmes... > -----Original Message----- > From: Jason Teagle [mailto:jason@teagster.co.uk] > Sent: Friday, May 31, 2002 4:35 PM > To: php-general@lists.php.net > Subject: [PHP] Writing Files (Unix, Apache, PHP 4.0.X) [Newbie Alert] > > I'm trying to open a file for writing using > > $hOutFile = fopen("filename.tmp","w"); > > but I'm getting "Permission denied". The directory has write permission > for > all user levels. Since this is the root www directory, I also tried > > > $hOutFile = fopen("subdir/filename.tmp","w"); > > but this also gave the "Permission denied". > > Can anyone suggest any reasons why this might happen? Do some hosts not > allow programs to write files like this? Database updates only? > > I see a note at http://www.php.net/manual/en/function.fopen.php > saying > "check your Apache permissions..." - forgive me for being an idiot, but > how > do I do that? {:v) > > > -- > -------------------------------------------- > _ _ > o o Jason Teagle > < jason@teagster.co.uk > v > -------------------------------------------- > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#100196) next »