php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42653 mkdir ("foo/bar/") not working
Submitted: 2007-09-13 09:33 UTC Modified: 2007-10-19 01:00 UTC
Votes:4
Avg. Score:4.5 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:1 (25.0%)
From: xavier at sdv dot fr Assigned:
Status: No Feedback Package: Directory function related
PHP Version: 5.2.4 OS: linux
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: xavier at sdv dot fr
New email:
PHP Version: OS:

 

 [2007-09-13 09:33 UTC] xavier at sdv dot fr
Description:
------------
With php 5.2.4 if $pathname has a trailing /, mkdir($pathname) don't work. This is a new behavior, it was working in php 5.2.3

Reproduce code:
---------------
<?
echo mkdir ("toto/")
?>

Expected result:
----------------
1

Actual result:
--------------
Warning: mkdir() [function.mkdir]: Unable to access toto/ in /www/root/default_vhost/a/index.php on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-13 09:41 UTC] jani@php.net
Works fine for me. Please give some more information, f.e. what SAPI you're using.
 [2007-09-13 13:00 UTC] xavier at sdv dot fr
The bug is occuring with mod_php against apache 1.3.37
I have the same problem with the CLI version

You can consult our phpinfo() : 
http://212.95.67.51/ and our php.ini 
http://212.95.67.51/php.ini
 [2007-09-13 15:14 UTC] iliaa@php.net
Do you have open_basedir and/or safe_mode enabled?
 [2007-09-13 17:10 UTC] xavier at sdv dot fr
Open basedir and safe mode are in effect, as you can see in the phpinfo

But they are not relevent. The mkdir fails within the allowed path, with corrects uid/gid.
If it was an open_basedir or safe_mode problem, mkdir("foo") whould fail like mkdir("foo/"). But this is not the case. mkdir("foo") works, mkdir("foo/") doesn't.

I even try the code with de CLI and a void php.ini, I have the same error.

With exactly the same configuration and PHP 5.2.3, both mkdir("foo") and mkdir("foo/") are working
 [2007-09-19 10:31 UTC] jani@php.net
Exactly what OS is this? (linux kernel version, distro, etc..)
 [2007-10-01 12:27 UTC] xavier at sdv dot fr
Sorry for the delay, I was on holydays

OS : fedora core 2, kernel 2.6.10 SMP
Apache/1.3.37
 [2007-10-19 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 Apr 25 14:01:31 2024 UTC