Search code examples
phpunlink

how to delete a php file using php?


I want to delete another php file from the server using unlink() function:

unlink('../classes/methods.class.php');

but I get a permession denied warning . although i made chmod 777 to that file


Solution

  • chmod - attempt to change permission of file or directory.

    You are most probably not permited to chmod file (if you have tried to change permittions trough PHP ) or to unlink since you are not file owner. See about file ownership, not just permittions.