Page 1 of 1

Permission denied

Posted: Thu Oct 26, 2006 7:02 pm
by phwhat?
I was making very basic amends to an rtf file and, though I never touched, looked at or went anywhere near lines 272, 273 or 274, I now get this error message :

Warning: fopen(../companies/mediapack.rtf) [function.fopen]: failed to open stream: Permission denied in /home/cosmetic/public_html/admin/sendmediapack.php on line 272

Warning: fwrite(): supplied argument is not a valid stream resource in /home/cosmetic/public_html/admin/sendmediapack.php on line 273

Warning: fclose(): supplied argument is not a valid stream resource in /home/cosmetic/public_html/admin/sendmediapack.php on line 274

Is it because I is Mac?!

Could anyone advise? :?

Posted: Thu Oct 26, 2006 7:32 pm
by RobertGonzalez
Those are the lines in your php file where your script is failing (and why).

Posted: Thu Oct 26, 2006 11:05 pm
by akimm
If you haven't already I suggest you use an FTP client to CHMOD this file, you recieved permissions denied, that sounds like your file might notbe set to 755

Permission denied

Posted: Fri Oct 27, 2006 3:50 am
by phwhat?
Thanks for your replies.
Sorry, yes, lines 272 to 274 in the php file are thus:

$fp= fopen("../companies/mediapack.rtf", "wb");
fwrite($fp, $data); # write to file
fclose($fp);

I don't know whether this is a php error, rtf error or that I've breached some security device in the system. I didn't change the php coding which would suggest one of the other two.

Errr... What's 755?

Posted: Fri Oct 27, 2006 10:24 am
by RobertGonzalez
That error means that PHP cannot open the file for reading/writing. 0755 is a Unix/Linux file/directory permission setting. Before messing the permissions you should read up on *nix file permissions and how they can affect the security of your server.