fopen access denied

ultra

Verified User
Joined
Sep 29, 2005
Messages
6
Location
my
php script
$file = 'chatlog.php';
$fp = fopen($file, 'a');
fputs($fp, $data);
fclose($fp);

error
Warning: fopen(chatlog.php): failed to open stream: Permission denied in
Warning: fputs(): supplied argument is not a valid stream resource in
Warning: fclose(): supplied argument is not a valid stream resource in

what could have gone wrong?
 
Make sure your apache has permissions to chatlog.php ( 664, at least ), and that it is owned by apache or at least in the same group as apache is run.

Other things to check for, is that the php.ini directive disable_functions does not list fopen, or the allow_url_fopen directive set to no. Also you might have to make sure php was not compiled with --disable-url-fopen-wrapper. Any of those things will not allow fopen to work properly.
 
Back
Top