Always_populate_raw_post_data = -1 , and yes, I did it


(TonnyMontana) #1

this is my error on installation:

always_populate_raw_post_data=-1

To prevent some critical issue, you must set the following in your php.ini file: always_populate_raw_post_data=-1
After making this change, restart your web server.


i’m on php 5.6.15
in phpinfo i have "always_populate_raw_post_data " = 0
but in php.ini i have equal to -1

so i don’t understand what is going on with this

need some help, please


(Matthieu Aubry) #2

did you restart your web server?


(TonnyMontana) #3

yes i did try,
interesting thing that it comes by default with -1 value, so i really can’t understand what is going on whit this.


(Zachary Goldsmith) #4

I’m having the same issue with PHP 5.6.14.
CentOS 6.7 Final
Linux version 2.6.32-573.3.1.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16)
Plesk Control Panel 12.5
Server version: Apache/2.2.15 (Unix)

Commands and output of wordaround:

$nano /etc/php.ini ====>[changed] ;always_populate_raw_post_data = On [to] always_populate_raw_post_data=-1
$service httpd restart [OK]
$php -i |grep always_ ====> [output] always_populate_raw_post_data => -1 => -1

Still have critical error in Piwik Web Setup.


(Zachary Goldsmith) #5

Could this be the culprit of Piwik not parsing this output correctly from phpinfo(); ? => -1 => -1 ?


(Zachary Goldsmith) #6

A temporary workaround is to skip the System Check by simply changing the URL in the setup process. to ?coreModule=setupDatabase


(TonnyMontana) #7

ok, i did found out where was my problem,

i installed php with make && make install, and not from repositories, so in my case php.ini was in /usr/local/lib and not in /etc/php.ini


(reda) #8

this seems to be a bug in php 5.6 (debian 8) always_populate_raw_post_data is always 0 in local section of phpinfo()

I commented the culprit line in piwik/plugins/Diagnostics/Diagnostic/PhpSettingsCheck.php line 71

# 71 //$requiredSettings[] = 'always_populate_raw_post_data=-1';


(Babel 13) #9

You right!!! @matthieu i forget restart the web server. Now is running as well


#10

I have the same issue. However, I can not change the values of the php.ini file. What should I do? Is there any workaround?


#11

I had the same problem. After changing the PHP version from 5.6 to 5.5 or 7.0, the upgrade works.


(Matthias) #12

Fine, that was the right note. Thanks.


(Lukas Winkler) #15

Hi, @Chr
I’ll try to explain it as simple as possible, I hope I don’t oversimplify something:

In older PHP versions you could use the variable $HTTP_RAW_POST_DATA to access the data submitted to a website. The PHP developers realized that this function shouldn’t be used and with PHP 5.6 created a warning saying so. Unfortunately this warning also appears in software that isn’t using $HTTP_RAW_POST_DATA (like piwik) and is creating new errors. To solve this one can set always_populate_raw_post to -1 to disable $HTTP_RAW_POST_DATA and as a result also remove the warning.

In PHP 7.0 $HTTP_RAW_POST_DATA was removed permanently, so nothing needs to be done there.


Required PHP configuration (php.ini)
Nach Update auf 3.1.0 keine Besucher mehr
(Michael Kallman) #16

I’m totally unaware of most server realted issues, but can follow instructions. Had the same problem with not being able to continue Piwik installation due to the ‘always_populate_raw_post’ value. I will go back and try the tip above that seemed to override the system check screen (everything else in the report is OK).

Anyway, I found some strange logic when the “error” was reported. Perhaps I’m just stupid but first there’s a line with the red circle and cross with text: always_populate_raw_post_data= - 1

THEN there’s a recommendation (in my case in Swedish) that says I have to change that value to avoid problems and that I have to set the value as: always_populate_raw_post_data= - 1 !?!?!

To me this is quite strange. A vaule is reported with a big no-icon and the advice is to set the value to the very same?

So what value is the correct one? Is it -1? If so I have to make a notice about the somewhat ambiguous advice.


(Lukas Winkler) #17

Hi @MickeK,

You are right that the icon can be misinterpreted, but the list is intended as a should-have-list with not fulfilled items colored in red.

So to answer your question:

Setting always_populate_raw_post_data to -1 is the correct setting.


(Michael Kallman) #18

Thank for sorting this out Lukas - and for an answer within 30 minutes! :slight_smile:


(Michael Kallman) #19

I might add a quicky quest related to posting from Zachary Goldsmith above:
“A temporary workaround is to skip the System Check by simply changing the URL in the setup process. to ?coreModule=setupDatabase”

If I understood the info above correctly the setting of ‘always_populate_raw_post_data’ not that relevant for function anylonger? Later PHP-versions doesn’t even have that value.

I haven’t got the help I need (yet) from the support of my server. I did a small php.ini and saved it in 'public_html ’ with the -1 value but I couldn’t re-start the server from my point of view. So nothing has happened so far. So, if it doesn’t matter at all if I follow the advice to jump the system check page as described I just might do that to get along.

Next step is setting the SQL database and I haven’t seen that info yet. I have a small SQL database at the server but I guess the Piwik will create a new one from scratch.

All my best. I really hope to see Piwik working on my sites as I liked the screen dumps illustrating the reports.


(Lukas Winkler) #20

Hi,

I don’t know if the workaround of setting the URL to ?coreModule=setupDatabase still works, but I wouldn’t really recommend it as it could always result in data corruption.

As I have mentioned above this issue is getting less important as it only occurs with PHP 5.6 and everyone should start using PHP7 or later, if only for the large performance boost.

There are many shared hosters where only the support is able to edit the php.ini so you’ll need them to fix it.

Piwik can use an existing database or create a new one on install.

I really hope you’ll be happy with piwik, If you’ll have a new question just post on this forum.


(Michael Kallman) #21

Hi Lukas,

First of all, I really respect the way you support us here with quick useful answers. Big help and trust from me for that.

Regardning my ‘struggle’ related to fixing the value in php.ini as descibed I am very disturbed by the answer the hoster of my sites mailed this morning. My choice is to accept the answer or reply with relevant info. I can’t say I know all about how things are handled on host server level, but on the other hand I can’t see why I’m not allowed to use Piwik services.

The mail say’s (I do a quite accurate translation from swedish and comment from me within paranthesis):

“I’m sorry but we can’t help you with the installation (didn’t ask them to install Piwik, just to let me or they edit the appropriate row in the ini-file) of this plug-in as it includes changes on global level that might create problems for other customers. I recommend you use the acces-logs where you at least can see the requests made (a rather crappy stat in my opinion).”

In addition he menition that they have re-started the server and if so the php.ini I created in ‘public_html’ was NOT initiated. Conclusion is that their php.ini is locked for individual customers (I admin a “top domain” for some customers of my own) as it’s out of access to me.

To recap, they suddenly removed the statistics that was a built-in-service to all of us before. I checked a couple of stat-plugs, and some of them do not require a lot, but I evaluated Piwik as the best one to me.

Can you perhaps comment their answer? Is there any relevance in their conslusions or are they just lazy? I really like to return an answer with substance if you believe the fix could be made easily.

If this ends as is I can’t use Piwik - if I don’t override the system test screen as mentioned above, and you didn’t recommend that. Perhaps it’s a good policy to guarantee function of your software and I understand that. But what would be the worst thing to happen and if so can’t I just un-install if things go wrong? I might add that I naturally con’t do anything that could cause som server breakdown or so ;).

All my best. Don’t know your GMT work hours but hopa I have an answer soon :).


(Lukas Winkler) #22

Hi,

Thanks, I try to do my best.

About your issue: I kind of understand your host as the point of shared hosters is not having a custom configuration. But in my opinion always_populate_raw_post_data is a bit different. It isn’t a setting that interferes with other customers, but rather a workaround for a specific bug in PHP 5.6.

But I am not sure if arguing about that is getting you very far. So I’d recommend you to ask you host if it is possible to switch to PHP 7. Every major hoster supports it now (but they won’t change it automatically as it could break old soltware.). That way the bug won’t appear, you can install Piwik without issues and it will probably be even faster because of the performance improvements.

Just one thing I want to make clear: I am not working for Piwik, but rather an Astronomy student how likes using open source software and wants to contribute back by voluntarily helping the Piwik team by moderating this forum and sometime adding new features to Piwik.

Have a nice weekend,

Lukas