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.
– Bulfaitelo
edited the question
– Pedro Henrique
when you run the command as terminal you are using the root user or sudo group, when running by apache, and another user,
– Bulfaitelo
root user use
– Pedro Henrique
a directory above the folder where you are trying to create this file runs the command
ls -aos
and put the result.– Bulfaitelo
4 drwxr-Xr-x 6 peter 4096 Jan 25 09:59 students
– Pedro Henrique
the folder is called students, where I’m trying to delete a file
– Pedro Henrique
Your goal is just to erase the
a.php
or have to erase using thephp
?– Bulfaitelo
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.
– Pedro Henrique
Let’s go continue this discussion in chat.
– Pedro Henrique