|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39953 chdir(..) not working in open_basedir where chdir(../) does !
Submitted: 2006-12-26 10:50 UTC Modified: 2007-01-03 01:00 UTC
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: zend at oliwel dot de Assigned:
Status: No Feedback Package: Directory function related
PHP Version: 5.2.0 OS: Linux
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 — but make sure to vote on the bug!
Your email address:
Solve the problem:
42 - 32 = ?
Subscribe to this entry?

 [2006-12-26 10:50 UTC] zend at oliwel dot de
Set open_basedir to /myscript
Try to do 'chdir("..")' from a file in /myscript/dir/ results in an open_basedir exception.
Using chdir("../") instead works.
PHPMyAdmin uses chdir("..") in the css/ directory, is not working with safemode turned on.

Reproduce code:
// create directory bugme before executing the script
echo getcwd();
echo getcwd();

Expected result:
Directory Change to upper directory on first call

Actual result:
Warning: chdir() [function.chdir]: open_basedir restriction in effect. File(..) is not within the allowed path(s): (/webtree/htdocs/sql/) in /webtree/htdocs/sql/test.php 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-26 10:53 UTC] zend at oliwel dot de
is not working with OPEN_BASEDIR turned on - nothing to do with safe_mode....
 [2006-12-26 11:07 UTC]
Please try using this CVS snapshot:
For Windows:

 [2007-01-03 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: Sun May 19 14:01:32 2024 UTC