Bug #74189 [Com]: weird notice on file upload
| From: | spam2 at rhsoft dot net | Date: | Wed, 01 Mar 2017 12:21:17 +0000 |
| Subject: | Bug #74189 [Com]: weird notice on file upload | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207631@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74189&edit=1
ID: 74189
Comment by: spam2 at rhsoft dot net
Reported by: costinel dot manole at gmail dot com
Summary: weird notice on file upload
Status: Open
Type: Bug
Package: *General Issues
Operating System: Centos 7
PHP Version: 7.1.2
Block user comment: N
Private report: N
New Comment:
just check the permissions of every parent folder and make sure nothing overrides
"upload_tmp_dir" - verify that with phpinfo()
Previous Comments:
------------------------------------------------------------------------
[2017-03-01 12:16:47] costinel dot manole at gmail dot com
I can copy or delete files from php in upload_tmp_dir.
But $_FILES['userfile']['tmp_name'] returns my sys_temp_dir
I have tried all combinations of folders including:
upload_tmp_dir = "/var/www/upload"
sys_temp_dir = "/tmp"
------------------------------------------------------------------------
[2017-03-01 11:44:32] nikic@php.net
The notice occurs if creating a temporary file in the specified directory failed and PHP has to fall
back to the system temporary directory. Can you please check whether the directory you specified by
upload_tmp_dir is actually writable by the user PHP runs under?
------------------------------------------------------------------------
[2017-03-01 11:39:07] spam2 at rhsoft dot net
> Anyway I have changed to
> upload_tmp_dir = "/var/www/upload"
> sys_temp_dir = "/var/www/upload"
>
> Same result
what do you expect?
"file created in the system's temporary directory"
and to solve it you set "upload_tmp_dir" and "sys_temp_dir" *again* to the same
value which is the problem
common sense:
upload_tmp_dir = "/var/www/upload"
sys_temp_dir = "/tmp"
------------------------------------------------------------------------
[2017-03-01 11:30:52] costinel dot manole at gmail dot com
On my server "/var/www/uploadtemp" is not shared by multiple apps.
Anyway I have changed to
upload_tmp_dir = "/var/www/upload"
sys_temp_dir = "/var/www/upload"
Same result.
I have eliminated all the PHP code from file. The PHP notice is generated with pure HTML Code
<form action="test_upload.php" method="post"
enctype="multipart/form-data">
<input name="userfile[]" type="file" id="userfile"
maxlength="" multiple />
<input type="submit" name="submit" value="Send File"></td>
</form>
If I attach 3 files I get 3 notices in error_log
------------------------------------------------------------------------
[2017-03-01 10:48:31] spam2 at rhsoft dot net
well i am not a php-developer but the point is *not* using /tmp which is shared between applications
and servies at all and so "what about just not using /tmp for file uploads" answering with
"i have tried /tmp/somesubdir" is strange
"Unknown on line 0" in that case is because it's no line of PHP code which triggers
that
so lwoer error reporting or just use sane uplod directories and don't open /tmp at all for a
webserver - in other words forbid it by eclude /tmp from open_basedir and anything else
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=74189
--
Edit this bug report at https://bugs.php.net/bug.php?id=74189&edit=1