|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57684 Relative paths are resolved relative to PHP binary
Submitted: 2007-05-25 17:17 UTC Modified: 2008-01-29 22:29 UTC
From: edwardzyang at thewritingpot dot com Assigned:
Status: Closed Package: svn (PECL)
PHP Version: Irrelevant OS:
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: edwardzyang at thewritingpot dot com
New email:
PHP Version: OS:


 [2007-05-25 17:17 UTC] edwardzyang at thewritingpot dot com
Some SVN functions modify the local filesystem, such as svn_checkout(), and accordingly accept target paths to perform the operations in. Some strange behavior happens when you pass a relative path to these functions: the path is resolved as if the current working directory was the one that contains the PHP binary.

The wrapper code needs to normalize the relative paths according to the current working directory, which shouldn't be too difficult as many other functions need to do the same thing. Users can workaround this problem by always specifying absolute paths (possibly using dirname(__FILE__))

Reproduce code:
svn_checkout('', 'target-directory');

Assuming that is a valid repository directory, /home/example/scripts is the current working directory, and PHP binaries are at /usr/bin

Expected result:
SVN repository is checked out at /home/example/scripts/target-directory

Actual result:
SVN repository attempts to be checked out at /usr/bin/target-directory


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-29 22:29 UTC] alan at akbkhome dot com
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

although it's missing a commit message.. (merged with 11153)
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 27 17:03:33 2022 UTC