-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Php 5.6 "Automatically populating $HTTP_RAW_POST_DATA is deprecated" #6465
Comments
always_populate_raw_post_data=-1 that would solve the problem if we don't use the variable that was deprecated (if I understand it correctly). What I don't understand though is that the warning appears regardless of whether an application uses that variable… I've had that warning on very small scripts that didn't use the variable at all. I find it weird that PHP 5.6 ships like that, maybe I'm missing something. |
I think it could be a bug in PHP 5.6 that was overlooked. Or maybe it's also triggered when something else than this variable is used. For example in the case of Piwik it seems to be triggered only for afew tests, those tests maybe that use Bulk tracking only? in bulk tracking for example we use |
It seems like there are several people meeting the same problem with codebases not using
When we read PHP 5.6 migration guide we read:
It seems that it's simple: to not get the deprecation, you need to disable this in i just find it stupid that PHP 5.6 ships with a config that makes it throw deprecation warnings automatically… |
As a follow up, using |
I got some feedback from the dev that added that to PHP (http://fr.reddit.com/r/PHP/comments/2jpzzj/php_56_throws_e_deprecated_by_default_for_no/):
So yes, by default PHP 5.6 ships with a configuration that throws deprecated notices… The only fix is for users to add this to their always_populate_raw_post_data=-1 For reference, the #internals discussion: http://www.serverphorums.com/read.php?7,1048319,1048407 |
Do you know what triggers the error? If so, maybe we can use a custom error handler to ignore the error so at least it won't break Piwik for people who upgrade. |
Some HTTP requests. It's not related to the code. |
Maybe we can catch it in Piwik's error handler? I guess if PHP throws it on startup, then not so much. |
FYI I posted new comment on the bug, it's our duty to fight for our users, won't give up so easily ;-) https://bugs.php.net/bug.php?id=66763 |
@mnapoli RE: "Some HTTP requests." By the looks of it: requests that use a payload, instead of regular requests (which use form-urlencoded encoded data) Works fine:
Throws out a
Ajax requests done using jQuery for example use a payload, and thus will trigger the warning 👎 |
users start to report this error eg. in this forum post |
I've blogged about it at http://www.bram.us/2014/10/26/php-5-6-automatically-populating-http_raw_post_data-is-deprecated-and-will-be-removed-in-a-future-version/, in hope people will find it when they Google that error. |
FYI added system check in #6468 to let users know about this pro-actively |
Maybe http://3v4l.org can help to spot the version differences? Made a quick test: http://3v4l.org/bO96q seems to change nothing. |
@powtac it's a INI setting that cannot be changed in a PHP file (it's a |
I see! Sorry. |
…input") This way, always_populate_raw_post_data can be set to -1 in php.ini and the quick search API no longer returns a broken result, due to PHP reporting a deprecation warning in JSON results: <br /> <b>Deprecated</b>: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in <b>Unknown</b> on line <b>0</b><br /> <br /> <b>Warning</b>: Cannot modify header information - headers already sent in <b>Unknown</b> on line <b>0</b><br /> {"link_type":"profile","profile_count":42,"profiles":[{ ... cf. http://php.net/manual/en/reserved.variables.httprawpostdata.php By the way, this PHP setting can't be usefully overriden with ini_set, matomo-org/matomo#6465 (comment)
always_populate_raw_post_data PHP setting Not set to -1. for drupal 8 site report shows this error how to fix it |
Apparently it is a bug from PHP 5.6 i stop receiving this warning after switching to php 7.0.10 |
Yes upgrading to PHP7 will fix this issue automatically 👍 |
yup! updated to PHP7, works! |
Please use Content-Type = application/x-www-form-urlencoded To solve this issue. |
This is working for me
|
Thanks, this is working for me too |
@rafiqbd, @Javaman79 |
Our build fails on 5.6 because of this warning.
It's quite annoying and I find lots of people online with the problem.
I'm not sure the proper way to fix this. a search in our code shows we don't use
$HTTP_RAW_POST_DATA
.Maybe we really need to edit
php.ini
and setalways_populate_raw_post_data
to-1
? (in this case we'd have to add system check to check users have set it to -1).See also:
The text was updated successfully, but these errors were encountered: