|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65482 fileperms function reports wrong permissions on a file with ACL
Submitted: 2013-08-20 03:25 UTC Modified: 2021-10-04 15:32 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: lukl at eabrno dot cz Assigned:
Status: Verified Package: Filesystem function related
PHP Version: 5.4.18 OS: Linux CentOS 6.4
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-08-20 03:25 UTC] lukl at eabrno dot cz
Executing a code bellow for a file/directory with extended permissions (ACL) 
return wrong results.
E.g. a file with these ACLs (display permissions using OS getfacl command):

# file: file
# owner: user
# group: apache

The PHP code however returns 0757, which is weird (other has no permissions at 
all, but according fileperms it has rwx).

When I clear any extended permissions, the PHP code returns expected result of 

Test script:

echo substr(decoct( fileperms("file") ) , 2);



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-10-04 15:32 UTC]
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2021-10-04 15:32 UTC]
Confirmed.  This is because fileperms() basically does a stat()
call, which doesn't actually check the ACLs.  This needs to be
documented.  See also bug #43817.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Sep 26 06:05:51 2022 UTC