php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66414 Wrong access mode
Submitted: 2014-01-04 21:59 UTC Modified: 2014-01-05 07:06 UTC
From: wouter at wouterj dot nl Assigned: krakjoe (profile)
Status: Closed Package: Directory function related
PHP Version: Irrelevant OS: not windows
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:
MUST BE VALID
Solve the problem:
26 + 11 = ?
Subscribe to this entry?

 
 [2014-01-04 21:59 UTC] wouter at wouterj dot nl
Description:
------------
---
From manual page: http://www.php.net/function.mkdir
---

Example #2 sets the access mode to 0, which means nobody can access it. It should use the default value (0777).

Test script:
---------------
$structure = './depth1/depth2/depth3/';

mkdir($structure, 0, true);

file_put_contents($structure.'/my-file.txt', 'hello world');

Expected result:
----------------
A file named 'my-file.txt' in './depth1/depth2/depth3/' with the content 'hello world' should be created

Actual result:
--------------
Warning: mkdir() [function.mkdir]: Permission denied in [...]

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-05 07:05 UTC] krakjoe@php.net
Automatic comment from SVN on behalf of krakjoe
Revision: http://svn.php.net/viewvc/?view=revision&revision=332580
Log: fix #66414 bad mkdir example
 [2014-01-05 07:06 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2014-01-05 07:06 UTC] krakjoe@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of krakjoe
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=50a515801ee034080dc27a9cf29e7ccfa2c23d5a
Log: fix #66414 bad mkdir example
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC