#39575 [NEW]: move_uploaded_file no longer working (safe mode related)

From: Date: Tue, 21 Nov 2006 23:08:34 +0000
Subject: #39575 [NEW]: move_uploaded_file no longer working (safe mode related)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-105274@lists.php.net to get a copy of this message
From: ch at hoffie dot info Operating system: Linux 2.6 PHP version: 5CVS-2006-11-21 (snap) PHP Bug Type: Safe Mode/open_basedir Bug description: move_uploaded_file no longer working (safe mode related) Description: ------------ While move_uploaded_file() correctly worked with PHP 5.2.0, it stopped working with recent snapshots of 5.2.1-dev (maybe earlier). Appearently PHP (main/safe_mode.c?) checks whether the target file exists -- and this obviously is never true for a file which is going to be moved there (but isn't there yet). ./configure --disable-all --disable-cli --enable-fastcgi Reproduce code: --------------- (with safe_mode enabled and a correct file upload POST request) <?php move_uploaded_file($_FILES['foo']['tmp_name'], "test.gif"); ?> Expected result: ---------------- The POSTed file should be moved to "test.gif" like in earlier PHP versions. Actual result: -------------- Warning: move_uploaded_file(): Unable to access /www/test.gif in /www/upload.php on line 2 No test.gif appears (although the permissions are correct; the uid of PHP is the same as the directory where test.gif should be put; nothing has been changed since the update from 5.2.0 to today's cvs snapshot) -- Edit bug report at http://bugs.php.net/?id=39575&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39575&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39575&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39575&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39575&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39575&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39575&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39575&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39575&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39575&r=support Expected behavior: http://bugs.php.net/fix.php?id=39575&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39575&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39575&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39575&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39575&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39575&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39575&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39575&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39575&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39575&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39575&r=mysqlcfg

« previous php.bugs (#105274) next »