Unlink() error permission denied

Asked

Viewed 189 times

1

if (file_exists("./a.php")) {
    chmod('a.php', 0777);
    unlink("./a.php");
}

I do not understand why still of the error in my code, I have already given the permissions via linux terminal with chmod 777 but it still doesn’t work, I try with php and not.

the errors are chmod() operation not allowed in ... and unlink('/a.php') operation denied in...

  • Please explain your problem better, it’s too vague.

  • edited the question

  • 1

    when you run the command as terminal you are using the root user or sudo group, when running by apache, and another user,

  • root user use

  • a directory above the folder where you are trying to create this file runs the command ls -aos and put the result.

  • 4 drwxr-Xr-x 6 peter 4096 Jan 25 09:59 students

  • the folder is called students, where I’m trying to delete a file

  • Your goal is just to erase the a.php or have to erase using the php ?

  • I want to delete with the use of php, so I can create a function that erases the files, ai to doing a test to delete this.

Show 5 more comments

1 answer

1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.