|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-09-14 12:35 UTC] kore@php.net
Description:
------------
mkdir() will fail, if open_basedir restricts the access to a path which is only a link, but not a real path.
Reproduce code:
---------------
Directory structure:
/path/
`- htdocs/
`- mkdir.php
`- var/ -> /path/var
`- var/
Ini settings:
open_basedir = '/path/htdocs:/path/var';
Code: (mkdir.php)
<?php
// This will work on Linux, BSD, but not on Solaris
mkdir('/path/htdocs/var/testdir');
Expected result:
----------------
Creating the directory.
Actual result:
--------------
Warning: mkdir(): open_basedir restriction in effect. File(/path/htdocs/var/testdir) is not within the allowed path(s): ('/path/htdocs:/path/var') in /path/htdocs/mkdir.php on line 2
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
Actually it doesn't work on ALL systems because of this: open_basedir = ' value ' is not the same as open_basedir = "value" Pay attention to this part of the error message: File(/path/htdocs/var/testdir) is not within the allowed path(s):------->('/path/htdocs:/path/var')<-------- Apparently /path/htdocs/var/testdir IS NOT within the "'/path/htdocs" directory.