Edit report at https://bugs.php.net/bug.php?id=55815&edit=1
ID: 55815
Comment by: svaneekelen at avt dot nl
Reported by: catch dot dave at gmail dot com
Summary: PUT request data should be parsed just like POST
Status: Suspended
Type: Feature/Change Request
Package: Streams related
Operating System: All
PHP Version: 5.4.0beta1
Block user comment: N
Private report: N
New Comment:
It is unbelievable that this is still not implemented after 11 years. This is one of the main
reasons why people leave php and consider it a old language. I think I don't need to repeat
what the other members on this form said but this is ridiculous there is no reason to not implement
a fix for this on the php side. The least that can be done is to upload in this case the file to
$_FILES what doesn't even happen in php 7.4 with put request. While it seems that the php dev
team does not even want to burn their fingers on this massive bug for 2 days because that is what it
would take because the logic exists already elsewhere. The least that php should do is bring in a
stable solution to read these files because this is basic functionality.
Previous Comments:
------------------------------------------------------------------------
[2020-06-25 13:55:31] me at daz dot one
I've been trying to figure out how to work with this issue without having to break RESTful
convention and boy howdie, what a rabbit hole, let me tell you.
I'm adding this anywhere I can find in the hope that it will help somebody out in the future.
I've just lost a day of development firstly figuring out that this was an issue, then figuring
out where the issue lay.
After trawling through a good few RFCs for php core, the core development team seem somewhat
resistant to implementing anything to do with modernising the handling of HTTP requests. The issue
was first reported in 2011, it doesn't look any closer to having a native solution.
That said, I managed to find a PECL extension called apfd (always populate form data). I'm not
really very familiar with pecl, and couldn't seem to get it working using pear. but I'm
using CentOS and Remi PHP which has a yum package.
I ran:
yum install php-pecl-apfd
and it literally fixed the issue straight away (well I had to restart my docker containers but that
was a given).
I believe there are other packages in various flavours of linux and I'm sure anybody with more
knowledge of pear/pecl/general php extensions could get it running on windows or mac with no issue.
If you're looking for a clean fix for this issue, I'd personally advise taking a look.
------------------------------------------------------------------------
[2020-06-24 14:29:41] me at daz dot one
I know this has been said MANY times but I can't believe this is still not implemented.
I get that it may not have been so essential in 2011 but in 2020 we now live in an age of REST APIs.
Having to break RESTful convention due to this feature not being implemented is literally crazy.
Is there anything I (or anybody else that needs this) can do to speed up getting it implemented?
Thanks.
------------------------------------------------------------------------
[2019-07-06 00:01:49] requinix@php.net
This needs to go through the RFC process. https://wiki.php.net/rfc/howto
------------------------------------------------------------------------
[2019-07-05 22:17:11] jasny@php.net
How ca, this be solved?
----
Change the type of ini setting enable_post_data_reading to a string. This setting takes
a comma-separated list with methods. E.g. "POST,PUT,PATCH".
For BC also allow a boolean: true is "POST" and false is
"".
---
This will likely need to be proposed as RFC rather than a simple patch.
------------------------------------------------------------------------
[2019-01-19 15:50:04] arkemlar at gmail dot com
The but exising over 8 years! Really, for me it sounds like:
- Me: Hey PHP, I want to implement nice restful API
- PHP: OK
... over time ...
- Me: What? I cant use PUT to modify my entity? WTF dude?
- Reqeust parsing for PUT is not implemented
- Why?
- Because maintainers __believe__ it should not be done for PUT
- This literally means: go and f**k urself man becasue now I forced to broke my perfectly designed
API by using POST whilest it must be PUT.
In age of RESTful API we cant simply use PUT, perfect!
------------------------------------------------------------------------
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=55815
--
Edit this bug report at https://bugs.php.net/bug.php?id=55815&edit=1