After upgrading to PHP 7.4 on BlueHost, one of my sites started giving this warning message when viewing the site:

Deprecated: Directive ‘allow_url_include’ is deprecated in Unknown on line 0

Sometimes it would occur with raw HTML formatting, reading:

<b>Deprecated</b>:  Directive 'allow_url_include' is deprecated in <b>Unknown</b> on line <b>0</b><br />

This caused several plugins to break, including:

Something went wrong 🙁

Unexpected token < in JSON at position 12043 (SyntaxError)

WordPress returned an unexpected message. This is probably a PHP error from another plugin.

Possible cause: <br /> <b>Deprecated</b>: Directive 'allow_url_include' is deprecated in <b>Unknown</b> on line <b>0</b><br />

REST API:

Unavailable  Check Again

Summary: Your REST API is not working and the plugin will not be able to continue until this is fixed.

The cause is that allow_url_include has been deprecated in PHP 7.4 because it is a bad idea, your server settings are enabling the warning message that only developers should ever see, and this is confusing these plugins.

To fix this on BlueHost:

  1. Log in to your control panel
  2. Select Advanced from the menu on the left
  3. Scroll down to the SOFTWARE group and select MultiPHP INI Editor
  4. Select location Home Directory
  5. Set PHP Directive allow_url_include to Disabled
  6. Set PHP Directive display_errors to Disabled
  7. Hit the Apply button at the bottom of the page
  8. Repeat steps 4-7 for each of your sites in the location menu

The solution on other hosting providers should be similar. If you can’t sort it out yourself, contact your host’s technical support and point them to this article so they can make the appropriate changes to your site’s PHP configuration settings.


Graham

I'm the creator of BuildYourBlog.net.