# php://input in CLI sapi

- Thread: https://externals.io/message/42463
- Original archive: https://news-web.php.net/php.internals/42463
- Started by Timm Friebe on 2009-01-03T14:19:42+00:00
- Messages: 2
- 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

---

## #42463 — Timm Friebe — 2009-01-03T14:19:42+00:00

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

Hi,
is there any reason php://input is not supported in CLI sapi? It would be 
nice to test raw post data reading in unittests without having to run them 
inside a web server sapi and it's only a five-line patch making php://input 
read from stdin in cli (attached).

- Timm

---

## #42468 — Alexey Zakhlestin — 2009-01-04T12:10:44+00:00

URL: https://externals.io/message/42463#42468 · In reply to: #42463

> Hi,
> is there any reason php://input is not supported in CLI sapi? It would be
> nice to test raw post data reading in unittests without having to run them
> inside a web server sapi and it's only a five-line patch making php://input
> read from stdin in cli (attached).

"POST DATA" is not relevant to CLI. While I understand what you are
trying to do, it feels like a hack.
I would suggest to work with "php://stdin" instead


-- 
Alexey Zakhlestin
http://www.milkfarmsoft.com/
