|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19757 odd mkdir vrs chmod fileperms
Submitted: 2002-10-04 14:31 UTC Modified: 2002-10-04 14:35 UTC
From: fandelem at hotmail dot com Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 4.2.0 OS: linux 2.4.9-7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: fandelem at hotmail dot com
New email:
PHP Version: OS:


 [2002-10-04 14:31 UTC] fandelem at hotmail dot com
This is reproducable, though very odd.

I have a script that does this:


which when I issue 'ls -la' produces:
drwxr-xr-x    2 apache   apache       4096 Oct  4 11:16 fandelem

However when I add:


which when I issue 'ls -la' produces:
drwxrwxrwx    2 apache   apache       4096 Oct  4 11:19 fandelem


I don't really understand why -- and I guess I could just have the code do an extra chmod() but I found it quite odd that this happens.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-04 14:35 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The mkdir call is affected by umask. Since on most systems (unix) default umask is 022 when it is applied to mode 0777 you get 755 directory permission.
To avoid this problem, do a call umask(0), before creating a directory.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 01 00:01:28 2023 UTC