0

There is a file(644, owner:apache) that I can't delete it using a PHP script with unlink function.

I can't figure it out why unlink fails to delete this file.

BTW, I have tried fclose it before unlink it. Unfortunately, it still didn't work.

“drwxrwxrwx 2 apache apache” apache have write access to the directory.

David Liu
  • 323

3 Answers3

2

Does apache have write access to the directory that the file is in ?

user9517
  • 117,122
0

What server operating system are you using? It's possibly SELinux causing this - if you have an OS with that installed, look in /var/log/secure or maybe /var/log/audit/audit.log for mentions of the file you are trying to unlink.

0

Sorry, guys. Problem solved.

It turns out the other mistake in my script have caused the problem. But I still learned a lot in this discussion. Thanks.

David Liu
  • 323