|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
25 + 40 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 18:01:28 2024 UTC