# PHP-5.6 php://input temp files

- Thread: https://externals.io/message/75170
- Original archive: https://news-web.php.net/php.internals/75170
- Started by Michael Wallner on 2014-07-02T17:56:40+00:00
- Messages: 7
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #75170 — Michael Wallner — 2014-07-02T17:56:40+00:00

URL: https://externals.io/message/75170#75170

Hi!

While hunting other bugs I noticed that the temp stream for php://input
stores its temp files in sys_temp_dir instead of upload_tmp_dir (of
course), which might be quite unexpected and cumbersome for a sysadmin.

I prepared a fix for that (tracked as bug #67551 [1]) as PR#705 [2].
If nobody objects, I'll merge it tomorrow into PHP-5.6 so it can
potentially end up in RC2.

[1] https://bugs.php.net/bug.php?id=67551
[2] https://github.com/php/php-src/pull/705

PS: Note, that the failed Travis build is due to the failing scalar
constant expression test case.

-- 
Regards,
Mike

---

## #75172 — Ivan Enderlin @ Hoa — 2014-07-02T17:59:18+00:00

URL: https://externals.io/message/75170#75172 · In reply to: #75170

> Hi!
Hi :-),


> While hunting other bugs I noticed that the temp stream for php://input
> stores its temp files in sys_temp_dir instead of upload_tmp_dir (of
> course), which might be quite unexpected and cumbersome for a sysadmin.
Are you sure this is the expected behavior? Did you confirm against a 
panel of sysadmins?

Cheers :-).

-- 
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/

PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/

Member of HTML and WebApps Working Group of W3C
http://w3.org/

---

## #75174 — Michael Wallner — 2014-07-02T18:24:42+00:00

URL: https://externals.io/message/75170#75174 · In reply to: #75172

Wat?


On 2 July 2014 19:59, Ivan Enderlin @ Hoa <ivan.enderlin@hoa-project.net>
wrote:

> 
>
> > […]
> Hi :-),
>
>
>
>  While hunting other bugs I noticed that the temp stream for php://input
> > […]
> Are you sure this is the expected behavior? Did you confirm against a
> panel of sysadmins?
>
> Cheers :-).
>
> --
> Ivan Enderlin
> Developer of Hoa
> http://hoa-project.net/
>
> PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
> http://disc.univ-fcomte.fr/ and http://www.inria.fr/
>
> Member of HTML and WebApps Working Group of W3C
> http://w3.org/
>
>
> --
> 
> 
>
>


-- 
Regards,
Mike

---

## #75175 — Iwan Luijks — 2014-07-02T18:34:21+00:00

URL: https://externals.io/message/75170#75175 · In reply to: #75174

Hi,

As it is noted in the section on php://memory and php://temp
(http://php.net/manual/en/wrappers.php.php#refsect2-wrappers.php-unknown-unknown-unknown-unknown-unknown-descriptios)
it wouldn't harm anyone if the fact could at least be noted at
php://input too.


Kind regards,

Iwan Luijks

--


Michael Wallner schreef op 2-7-2014 20:24:
> Wat?
>
>
> On 2 July 2014 19:59, Ivan Enderlin @ Hoa <ivan.enderlin@hoa-project.net>
> wrote:
>
> > […]

---

## #75176 — Michael Wallner — 2014-07-02T18:43:34+00:00

URL: https://externals.io/message/75170#75176 · In reply to: #75175

>
> Hi,
>
> As it is noted in the section on php://memory and php://temp
> (
http://php.net/manual/en/wrappers.php.php#refsect2-wrappers.php-unknown-unknown-unknown-unknown-unknown-descriptios
)
> it wouldn't harm anyone if the fact could at least be noted at
> php://input too.

To the unaware readers:  This is about the new behavior in PHP-5.6 where
documentation for that functionality will be updated from UPGRADING.

---

## #75179 — Levi Morrison — 2014-07-02T21:16:17+00:00

URL: https://externals.io/message/75170#75179 · In reply to: #75170

> Hi!
>
> While hunting other bugs I noticed that the temp stream for php://input
> stores its temp files in sys_temp_dir instead of upload_tmp_dir (of
> course), which might be quite unexpected and cumbersome for a sysadmin.

I can understand why you would put it in upload; the php://input
stream is the raw data for the request which is most commonly used in
uploads via PUT or POST.

However, it did take me a few minutes to realize this. I would not
have expected it to be in the upload tmp directory instead of the
system temp directory.

---

## #75201 — Michael Wallner — 2014-07-03T07:59:28+00:00

URL: https://externals.io/message/75170#75201 · In reply to: #75179

> 
> > […]
>
> I can understand why you would put it in upload; the php://input
> stream is the raw data for the request which is most commonly used in
> uploads via PUT or POST.
>
> However, it did take me a few minutes to realize this. I would not
> have expected it to be in the upload tmp directory instead of the
> system temp directory.
>

Yet, you only have an argument for my expectation not yours, or am I
missing something?
php://input is *only* not *most commonly* used for input data over the wire.

-- 
Regards,
Mike
