Deprecated PHP Error in WordPress

computer problem

I recently discovered a repeating message in the error log of a customer’s WordPress installation.

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

Here’s what that means and what to do if this is happening to you.

What is PHP?

WordPress uses a scripting language called PHP.   Just like software, there are different versions of PHP.  The customer was using PHP 5.6.  The error message is saying that the site is using a function (that’s like a command) that’s fine in 5.6, but that won’t be available in PHP 7.

This matters because it’s expected that later this year WordPress is going to start requiring PHP 7.

Recommended Course of Action

At some point, probably within a year, all WordPress sites are going to need to be on PHP 7.  It’s better to make the move in a controlled way and at the time of your choosing.  That way if something does break, then you can roll the site back and fix it.

First, you should make a backup of your site.  Maybe your website host can do this.  If not, check out this article from WPBeginner.

You shouldn’t really need the backup, but it’s always good to have backups.

Thinking about making a major change to your website?  Make a backup.

Second, install the PHP Compatibility Checker Plugin from WP Engine.  Note that it doesn’t catch all PHP compatibility issues, but it’s a good place to start.

Lastly, call your website host and ask them to switch to PHP 7 while you’re on the phone.

With most hosts changing PHP versions is a quick flip of the switch.  Take a look at your site and see if anything breaks.  While you’re looking at your site ask your host to look at the error logs.

If nothing breaks . . . Yay!  No more error message and PHP 7 runs a lot faster than older versions of PHP.

If there are problems ask technical support to put you back on the old version of PHP.  Then you’ll need to fix the issues.  Probably this will involve finding plugin replacements.

Once you’ve fixed as much as you can call your website host and try updating to PHP 7 again.

If you need help with updating your site to PHP 7, contact me.  I’d be happy to help!

Leave a Reply

Your email address will not be published. Required fields are marked *