|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42739 mkdir doesnt like a trailing slash when safe_mode is enabled
Submitted: 2007-09-23 09:36 UTC Modified: 2008-02-26 01:00 UTC
Avg. Score:3.8 ± 1.4
Reproduced:12 of 14 (85.7%)
Same Version:9 (75.0%)
Same OS:5 (41.7%)
From: yurtesen at ispro dot net Assigned:
Status: No Feedback Package: Safe Mode/open_basedir
PHP Version: 5.2.5 OS: FreeBSD 6.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: yurtesen at ispro dot net
New email:
PHP Version: OS:


 [2007-09-23 09:36 UTC] yurtesen at ispro dot net
When safe_mode is enabled mkdir('newdir/',0770); doesnt function. When safe_mode is disabled it functions fine. Sure, there shouldnt be a trailing slash there perhaps but most PHP software uses paths similar to '/home/user/domain/test/' so this is a problem.

This appeared in 5.2.3 or 5.2.4 I am not so sure.

This is not a permissions based problem as the folder is created when backslash is not used in safe_mode, and it is created when backslash is used and NOT in safe_mode

It seems to be the same bug with(perhaps somehow reintroduced?):

Reproduce code:

The problem is the trailing slash and safe_mode...

Expected result:
myhomefolder should get created.

Actual result:
Warning: mkdir(): Unable to access myhomefolder/ in /home/user/domain/test.php on line 3


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-23 15:19 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2007-11-27 12:36 UTC] yurtesen at ispro dot net
I see the same error in 5.2.5 release. Are you sure that this is fixed? When you said that it is fixed in CVS it was in September, now 5.2.5 came out and the same bug exists...
 [2008-02-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 11:01:31 2024 UTC