Jump to content

Php: Unlink()


sitesure
 Share

Recommended Posts

I'm attempting to use unlink($file) without any results. Is that function disabled in our PHP configuration? Or, am I doing something wrong? I've passed both relative and absolute paths -- and verified (file_exists()) that the filename is correct... no luck.

 

Any work-arounds?

 

I'm trying to delete files based on user parameters (i.e., date/time).

 

Thanks,

Bill

Link to comment
Share on other sites

Make sure to set the CHMOD of the PHP script correctly. Make sure to CHMOD the folder correctly. And the files, too.

 

I've got a PHP script that uses unlink() and the function does work....

 

>unlink("../dir1/dir2/$Game_ID.$Ext");

is one modified snippet. CHMODS -- The PHP script executing it is 644, the folder the script is in is 755, the folder the file is in is 777 (I could tinker with this, but wont), and the file itself is in 644.

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

 Share

×
×
  • Create New...