|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51611 move_uploaded_file fails with open_basedir
Submitted: 2010-04-20 06:24 UTC Modified: 2013-02-18 00:34 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: f dot moretti at diciannove dot net Assigned:
Status: No Feedback Package: Safe Mode/open_basedir
PHP Version: 5.2.13 OS: linux 2.6.18
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.
Block user comment
Status: Assign to:
Bug Type:
From: f dot moretti at diciannove dot net
New email:
PHP Version: OS:


 [2010-04-20 06:24 UTC] f dot moretti at diciannove dot net
I have this vhost settings:

<Location />
  php_admin_value   open_basedir      /home/data/
  php_admin_value   doc_root          /home/web/
  php_admin_value   upload_tmp_dir    /home/data/

doing a move_uploaded_file to the upload_tmp_dir result in a failure:

PHP Warning:  move_uploaded_file(): open_basedir restriction in effect. File(/home/data/ is not within the allowed path(s): (/home/data/ in /home/web/ on line 11

In the same error string is visible that the upload_tmp_dir path is in the open_basedir directive.

I'm on a debian VM with linux 2.6.18 kernel, the /home dir is mounted via NFS and apache is chrooted with mod_chroot. 

Test script:
Any simple upload script with these lines of code:

    $from = $_FILES['uploadedfile']['tmp_name'];
    $flog = ini_get('upload_tmp_dir').$_FILES['uploadedfile']['name'];


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-27 21:03 UTC]
-Status: Open +Status: Feedback
 [2010-04-27 21:03 UTC]
Please try using this snapshot:
For Windows:

 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 20:01:29 2024 UTC