From: nyaka at nyaka dot com
Operating system: Solaris 10
PHP version: 5.2.6
PHP Bug Type: Apache2 related
Bug description: Problem uploading a file
Description:
------------
I'm trying to upload a file with PHP 5.2.6 and Apache 2.2.9 from a custom
application. It worked for me previously with Apache 1.3 and PHP 4.3.
I also tried to use PHP 5.2.7RC3-dev (cli) (built: Nov 4 2008 20:43:51).
Same results.
Reproduce code:
---------------
<?php
error_log(print_r($_FILES, TRUE));
?>
Expected result:
----------------
I expect the file to be uploaded and $_FILES array to contain correct data
about that file and not an error message.
Actual result:
--------------
This is from the apache error log:
Array
(
[wav] => Array
(
[name] => msg-94_48972.wav
[type] =>
[tmp_name] =>
[error] => 3
[size] => 0
)
)
This is trace of httpd with truss:
.......
8469: read(23, " P O S T / v o i c e m".., 8000) = 4344
8469: stat64("/share/web/snom/voicemail.php", 0x08047880) = 0
.......
8469: time() = 1225822869
8469: resolvepath("/tmp", "/tmp", 1024) = 4
8469: getpid() = 8469 [8463]
8469: lstat64("/tmp/phpjFaOIq", 0x08044800) Err#2 ENOENT
8469: open("/tmp/phpjFaOIq", O_RDWR|O_CREAT|O_EXCL, 0600) = 24
8469: write(24, " R I F F92 6\0\0 W A V E".., 5119) = 5119
8469: write(24, " nDCB895EA04 69A1C I n '".., 5119) = 5119
8469: read(23, " nD504 H8EE3C8 rCB\0B691".., 8000) = 2346
8469: write(24, " 2C4E215B9 aD6 <E6 J aD9".., 3779) = 3779
8469: close(24) = 0
8469: unlink("/tmp/phpjFaOIq") = 0
.......
8469: resolvepath("/share/web/snom/voicemail.php",
"/share/web/snom/voicemail.php", 1024) = 29
8469: open("/share/web/snom/voicemail.php", O_RDONLY) = 25
.......
I can see here that the temporary file is actually created and the data is
written to it. But after the file is closed an unlink is executed.
I can provide TCP dump if necessary.
--
Edit bug report at http://bugs.php.net/?id=46485&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46485&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46485&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46485&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46485&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=46485&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46485&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=46485&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=46485&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=46485&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=46485&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=46485&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46485&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46485&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46485&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46485&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46485&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=46485&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=46485&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=46485&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=46485&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=46485&r=mysqlcfg