Always_populate_raw_post_data = -1 , and yes, I did it

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.

1 Like

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

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

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

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';

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

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?

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

Fine, that was the right note. Thanks.

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.

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.

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.

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

1 Like

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.

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.

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 :).

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

Thanks again Lukas. Sorry about my conclusion that I was talking to Piwik support. You was that fast in answering that it had to be support - noticed that I had to pay for support with direct mailing so my interpretation was that this forum was a solution to help general quest.

I admire all contributers as yourself, and try to do the same with subjects I have skills around. BTW Astronomy interest me a lot as amateur with fascination of how much we know about our existance. It’s just breathtaking that we can look out, back and forward as we do and sorry to say that people in general don’t havev enough imagination to understand the fact of the Universe (or for that matter Homo Sapiens development on Earth). Was I 20 again and preparing for an education I would probably try Astronomy :). All my best for the future and thank’s for all input as we now close the subject.

PS. I might report what happened. I do not dare to override the System check screen IF NOT anyone here can guarantee that it is safe.

A post was split to a new topic: Piwik not collecting any stats after fresh install

Thanks !

always_populate_raw_post_data = -1