Is there a way to debug why I get
lstat("/path/to/file", 0x...) = -1 EACCES (permission denied)
error when accessing a file/directory? whether it is because of selinux issues or because of user/group permission or NFS or any ACLs that might be coming into play?
I was having the correct permissions set on a directory for a user and I was able to create a file in that directory after logging in as the user. However when PHP is running under the Apache scope with the same user and group, it fails to create the file.
I understand Apache is using suid to change from "root" to the required user but still when PHP executes under Apache, the file is not created. Also, PHP prints out correct and expected real and effective user IDs (instead of root).
For those interested, the /path/to/file is on an NFSv4 mount, but I would like to investigate, due to what reasons, the permission is being denied.
Would it be possible to know!?