Jump to content

unlink() permission denied


sanfly

Recommended Posts

Hi Guys

Im trying to use unlink() to delete an image on my home computer server (WAMP5), but am getting the following error:

[quote]
Warning: unlink(images/users/) [function.unlink]: Permission denied in C:\server\www\NZSO\users.php on line 1218[/quote]

Any ideas on what to do to get around this?

Cheers
Link to comment
https://forums.phpfreaks.com/topic/30196-unlink-permission-denied/
Share on other sites

Did you check the permisisons of the file like drifter said? If you uploaded and wrote the file using fwrite or something like that, it is probably owned by www-data or whatever your wed server's system user is (even if your upoad script was run by you). You would need to change either the owner/group and/or relax safe_mode to match GID and not UID. Creating and removing files through PHP is difficult to get right given the security/permission problems.
[quote]check open base dir is not set in the php.ini file[/quote]

Its not set

[quote]Did you check the permisisons of the file like drifter said? If you uploaded and wrote the file using fwrite or something like that, it is probably owned by www-data or whatever your wed server's system user is (even if your upoad script was run by you). You would need to change either the owner/group and/or relax safe_mode to match GID and not UID. Creating and removing files through PHP is difficult to get right given the security/permission problems.[/quote]

How do I check the permissions?  Im running WAMP5 (apache/mysql/php) on my home PC.  I didnt use fwrite, basically just move_uploaded_file()

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.