Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8119779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:54:28+00:00 2026-06-06T04:54:28+00:00

PHP experts, I’ve been working on this problem for about a day and a

  • 0

PHP experts, I’ve been working on this problem for about a day and a half, and I’m at a loss. If I’m right, I’ve discovered an arguably huge oversight in PHP.. one I can’t believe isn’t causing problems for others, and while I’ve found others having the same problem via Google, all of them have accepted defeat. One even filed a bug with PHP, and it was eventually closed due to lack of activity.

I’m running PHP 5.3 w/ Apache in a WAMP stack.

I’m doing a simple file upload (followed by a move from the tmp location), and for security and speed reasons, I’d like the initial upload temp directory (upload_tmp_dir) to be on a different disk where the file will end up after the move, which happens to be a network share. Z:\temp. Normally, it resides on the same disk as PHP, but this would mean that I have to upload a potentially large file, then wait for it to copy to another disk.. rather than just upload it to the other disk AS the temp, and perform a quick move.

example:

//upload_tmp_dir = Z:\Temp (set in php.ini)
$targetpath = Z:\Data\pdfs (final destination)
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $targetpath);

Theoretically, this should upload the file temporarily to Z:\Temp, then once it completes without errors, move it to its’ final destination of Z:\Data\pdfs\filename.pdf.

I’ve confirmed that file uploading and moving works as long as upload_tmp_dir is on the same drive PHP is.. i.e. C:\MyTemp, but will NOT work if I traverse to a different drive like Z:\Temp. The value I specified in php.ini for upload_tmp_dir is simply ignored, and the file gets stored in C:\Windows\Temp if I try to traverse to a different drive/partition. Seems to make no difference that it’s a mapped drive. Permissions are all set correctly, both share and security have Everyone allowed (chmod 777 equivalent).

I’ve read in multiple locations that “PHP” and specifically move_uploaded_file() “has trouble with traversing drives”. This is obviously for security reasons I’d assume, but it doesn’t seem it can be overridden anywhere. However, with an increasing number of servers using virtualization and SSD’s with limited space, I don’t understand how this is possible. If one was running a site with several hundred users uploading files at a time, how does it make sense that the temporary files (which could be huge) MUST reside on C:\ where PHP is?? Have any of you dealt with this before or have any tips?

I keep assuming it’s a permissions issue and so I’ve looked into other PHP and Apache settings which might be limiting the access, but even setting all the paths in open_base_dir for example doesn’t seem to help anything.

Some posts I found outlining the same or similar issues:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/Q_21190386.html

https://serverfault.com/questions/128017/php-ignores-upload-tmp-dir

https://bugs.php.net/bug.php?id=44420

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:54:29+00:00Added an answer on June 6, 2026 at 4:54 am

    This guys says:

    mapped drives are user specific, the webserver, and consequentially php, run under a different username

    http://forums.phpfreaks.com/index.php?topic=175349.0

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure if PHP can do this so I thought I'd ask the experts:
I need some advice from experts :) I will develop a website using PHP
I've made this question: PHP mutual exclusion (mutex) As said there, I want several
This is a newbie question to AJAX experts: In case an unauthenticated user tries
Hello to all jQuery enthusiasts and experts!! I currently use on a project this
Building a website using a PHP based Ecommerce product Magento. The problem I have
I'm working on a project(PHP Based) in which I need to compute SHA1, I'm
I have an config.php file where I simply make an huge array that contains
I've had this problem before before with no real resolution. It's happening again so
I've just read the page on Expressions in the PHP docs, and right at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.