From: mb at smartftp dot com
Operating system: Windows 2003
PHP version: 5CVS-2006-10-14 (snap)
PHP Bug Type: PHP options/info functions
Bug description: file_uploads option in windows registry not working
Description:
------------
I'm running PHP as a CGI on Apache 2.2 on Windows 2003.
In the php.ini file_uploads is set to On:
file_uploads = On
In the registry the following values are set:
[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\Per Directory Values\c\home\htdocs]
"file_uploads"="0"
or
"file_uploads"="Off"
The test.php file (see Reproduce code) is located in the following
folder:
c:\home\htdocs
The ini_get("file_uploads") reports the correct value (0) but file uploads
are still working. Also phpinfo() reports the correct local and master
values.
The same problem happens file_uploads are set to Off in the php.ini and
the file_uploads variable is set to "1" or "On" in the windows registry.
In this case uploads won't work.
Mathias Berchtold <[EMAIL PROTECTED]>
Reproduce code:
---------------
Use the following code and upload a file and watch the result.
test.php
<html>
<body>
<?php
if(empty($_FILES))
print("_FILES is empty.<br>");
else
print_r($_FILES);
print("<br>");
$bResult = ini_get("file_uploads");
print("ini_get(\"file_uploads\") = ".$bResult);
print("<br>");
?>
<form enctype="multipart/form-data" method=POST>
<input type=file name="file">
<input type="submit">
</form>
<?php
phpinfo();
?>
</body>
</html>
Expected result:
----------------
Case A:
With the following pre-conditions:
php.ini
file_uploads = On
and
Windows Registry
file_uploads = "0"
I expect the $_FILES variable to empty.
Case B:
With the following pre-conditions:
php.ini
file_uploads = Off
and
Windows Registry
file_uploads = "1"
I expect the $_FILES variable not to be empty.
Actual result:
--------------
File uploads solely depend on the file_uploads value in php.ini. The
windows registry seems to override this setting but in reality it doesn't
affect uploads.
--
Edit bug report at http://bugs.php.net/?id=39156&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=39156&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=39156&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=39156&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39156&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=39156&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39156&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39156&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39156&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39156&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39156&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=39156&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=39156&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39156&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39156&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39156&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39156&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39156&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39156&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39156&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39156&r=mysqlcfg