|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8044 rename() with relative paths - wrong behaviour
Submitted: 2000-11-30 02:56 UTC Modified: 2000-11-30 04:08 UTC
From: christian at wenz dot org Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.3pl1 OS: Win32
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 !
Your email address:
Solve the problem:
31 + 4 = ?
Subscribe to this entry?

 [2000-11-30 02:56 UTC] christian at wenz dot org
create a file c:\temp\temp.txt
Now create a PHP file, but not in the root directory of your webserver, but in a subdirectory of it, that contains this command:

rename("c:\\temp\\temp.txt", "temp.txt");

Now run this script from your webbrowser (e.g. http://server/subdir/rename.php)

The file is now moved away from c:\temp, but not into the directory where rename.php resides in (as one would guess), but in the root directory of the web application!


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-30 04:08 UTC]
this is already fixed, wait for 4.0.4 or get a dev version i.e. from
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Jun 09 12:03:39 2023 UTC