Skip to content
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

Cannot Star/Unstar : Internal Error #565

Closed
Keyhaku opened this issue Sep 25, 2014 · 6 comments
Closed

Cannot Star/Unstar : Internal Error #565

Keyhaku opened this issue Sep 25, 2014 · 6 comments
Labels

Comments

@Keyhaku
Copy link

Keyhaku commented Sep 25, 2014

Hi,

I've just met a problem with the star/unstar system, see my nginx log, by uncommenting the line
";always_populate_raw_post_data = -1" in php5.ini i've managed to make it work.

According to php manual (http://php.net/manual/en/ini.core.php), this directive is obsolete from php 5.6 (that the version I'm using).

Regards.

Log

*182 FastCGI sent in stderr: "PHP message: Fatal error: 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"

@niol
Copy link
Collaborator

niol commented Sep 26, 2014

I cannot find any obvious usage of $HTTP_RAW_POST_DATA in selfoss. Which version are you using?

@Keyhaku
Copy link
Author

Keyhaku commented Sep 27, 2014

Hi,

I'm using the latest version of selfoss (2.12).

Regards.

@niol
Copy link
Collaborator

niol commented Sep 30, 2014

Do you have a line number for the error? I'll try to reproduce when I get the chance to upgrade to PHP 5.6.

@SSilence SSilence added the bug label Oct 9, 2014
@dubbl
Copy link
Contributor

dubbl commented Dec 17, 2014

Other open source projects are having the same problem with PHP 5.6 (matomo-org/matomo#6465)

We don't use/access $HTTP_RAW_POST_DATA, the warning occurs during the population of this variable, even before the selfoss code is executed. The warning is caused by an HTTP POST request with a payload other than 'Content-Type: application/x-www-form-urlencoded' (I think the starr/unstarr request has an empty payload, which makes this warning even more weird).

The only "fix" seems to be to downgrade PHP or to set always_populate_raw_post_data to -1 in the php.ini. Here is the PHP bug report https://bugs.php.net/bug.php?id=66763. Apparently even more applications would break if they would set always_populate_raw_post_data to -1 as a default.

@jtojnar
Copy link
Member

jtojnar commented Mar 10, 2015

As temporary fix you can replace line 1757 in libs/f3/base.php

    if ($error=error_get_last())

with

    $ignored = "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.";
    if ($error=error_get_last() && isset($error) && $error['message']!==$ignored)

The issue is described in detail in this blog post.

Maybe we should also start an issue in https://github.com/bcosca/fatfree

jtojnar added a commit to jtojnar/selfoss that referenced this issue Jan 10, 2017
Fixes another instance of fossar#565, this time when refreshing single source.
@jtojnar
Copy link
Member

jtojnar commented Feb 4, 2017

Closing since it was fixed in #664. Please open a new issue when it reappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants