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:
- Jetpack would no longer connect due to the extra content in XML-RPC, as shown in the recommended test like: https://buildyourblog.net/xmlrpc.php?for=jetpack
- The Redirection plugin started throwing this scary error when accessed via the Tools -> Redirections menu:
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:
Summary: Your REST API is not working and the plugin will not be able to continue until this is fixed.
- The Yoast SEO XML Sitemap appeared blank, and you couldn’t even access the View Page Source option in Chrome to debug it. However, the contents of the sitemap did appear if viewed in Chrome’s Developer Tools. Weird.
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:
- Log in to your control panel
- Select Advanced from the menu on the left
- Scroll down to the SOFTWARE group and select MultiPHP INI Editor
- Select location Home Directory
- Set PHP Directive allow_url_include to Disabled
- Set PHP Directive display_errors to Disabled
- Hit the Apply button at the bottom of the page
- 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.