Jump to content

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()
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.