PHP unlink can’t delete file while I can unlink this file in Linux shell

PHPunlink

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.

Best Answer

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