PHP Warning: $HTTP_RAW_POST_DATA is deprecated


#1

Hello,

Has anyone else gotten this warning? Some of my data is not importing and I get this warning from php. I’m running
PHP Version 5.6.1
System Windows NT NYX 6.0 build 6002 (Windows Server 2008 Standard Edition Service Pack 2) i586
Build Date Oct 1 2014 13:19:15
Compiler MSVC11 (Visual C++ 2012)
Architecture x86
[31-Oct-2014 18:35:02 UTC] PHP Deprecated: 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 Unknown on line 0
[31-Oct-2014 18:35:02 UTC] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0

Thank you for your time,


(Matthieu Aubry) #2

Thanks for the report. This is discussed in Php 5.6 "Automatically populating $HTTP_RAW_POST_DATA is deprecated" · Issue #6465 · matomo-org/matomo · GitHub

The only solution is to set always_populate_raw_post_data to -1 in the php.ini


(Vikas Sharma) #3

After set always_populate_raw_post_data to -1 in the php.ini i am getting same error

"Deprecated: 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 Unknown on line 0

Warning: Cannot modify header information - headers already sent in Unknown on line 0"


(Fabian Dellwing) #4

Did you set it in the correct php.ini?

For debian/ubuntu this should be:
PHP < 5.6: /etc/php5/apache2/php.ini or /etc/php5/fpm/php.ini
PHP >= 5.6: /etc/php/PHPVERSION/apache2/php.ini or /etc/php/PHPVERSION/fpm/php.ini

Afterwards restart you apache or the correct fpm server if you use php-fpm.


(Vikas Sharma) #5

yes after set under php.ini i restarted apache


(Lukas Winkler) #6

Hi,
Can you check with an

<?php
phpinfo();

file if this php.ini change has been applied.