PHP 5.6 HTTP_RAW_POST_DATA is deprecated and will be removed in a future version

Home Forums BulletProof Security Pro PHP 5.6 HTTP_RAW_POST_DATA is deprecated and will be removed in a future version

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #24793
    jenni101
    Participant

    Hi there,

    I’ve recently changed the php version on my server from php 5.3.29 to 5.6. All seems to have gone well, but after a while i saw lots of php errors showing up in my cPanel php error log, in the log folder (NOT in the BPS Pro php error logs) with this error:

    [01-Sep-2015 08:06:33 Pacific/Auckland] 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

    After a bit of searching it appears that the php v 5.6 has a minor bug, which can be corrected by adding this to the php.ini file. (See these threads for this info: http://stackoverflow.com/questions/26679157/why-is-http-raw-post-data-being-called and https://github.com/piwik/piwik/issues/6465 ).

    always_populate_raw_post_data=-1

    So I’ve added that to my root php.ini file, but still seem to be getting the errors. So I’m not sure if I have to add it to the BPS Pro ‘my-master-phpini.ini’ file too? I’ve run the BPS search for exisiting php.ini files and it shows this:
    /home/mysite/public_html/.php.ini
    /home/mysite/public_html/wp-content/bps-backup/autorestore/root-files/.php.ini
    /home/mysite/public_html/wp-content/plugins/s2member/includes/mime-types.ini
    /home/mysite/public_html/wp-content/plugins/bulletproof-security/admin/php/my-master-phpini.ini
    /home/mysite/public_html/wp-content/plugins/bulletproof-security/admin/php/bpspro-base-phpini.ini

    #1 = my root php.ini that was added by my hosting to increase my memory limit etc, and this is where I’ve added the new additional code.
    #2 = identical to #1
    #4 = empty
    #5 = looks like the original that comes with BPS

    And I’ve run your recommended php.ini test to see if my code is effective from the root php.ini file (#1) – and it is. So my questions are: do I have to add the code ‘always_populate_raw_post_data=-1’ to #4 to be effective? if you’ve come across this problem, is there anything else I can do to fix it?
    Sorry to be so long-winded.

    many thanks, J

    #24802
    AITpro Admin
    Keymaster

    You would add the php.ini directive code in your root php.ini file:  /home/mysite/public_html/.php.ini.  I recommend that you contact your Host about this because your Host may not allow that directive in a php.ini file.  Only they will be able to tell you whether the directive is allowed or not and if the server will allow it to be used.  Another reason to contact your Host is I am sure they will want to fix this for everyone and not just you. 😉

    #24813
    jenni101
    Participant

    @ aitpro_admin many thanks – good idea! I will post back here with any further info I get.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.