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