Error msg libxml_disable_entity_loader

Hi,
I created a staging site for making changes on the production site. On the staging site, I noticed for every page/article where there’s a connexion to the Discourse forum, that I get this error:
Warning : libxml_disable_entity_loader() has been disabled for security reasons in /www/way_to_my_puglin_folder/wp-discourse/lib/template-functions.php on line xxx

Since it’s a staging, I figured that Discourse didn’t recognize the legit website and deactivated some stuff. However, I just pushed the staging to production, and the error is still there (on the production site, with the legit URL). Any clue what I can do to get rid of it?

So noboby has any idea what’s happening here?
(btw, last versions of WP and the Discourse plugin on PHP 7).

Maybe @angus can help?

1 Like

Hey @Romain_Bisseret,

The issue here is arising because your hosting provider has disabled a PHP function called libxml_disable_entity_loader, which is used in the WP Discourse plugin.

That function is used in a wide variety of Wordpress plugins, and is fully supported in PHP 7.*, however it has been deprecated in PHP 8.0. We’ll be deprecating it in the WP Discourse plugin in the near future, alongside other work to ensure full compatability with PHP 8.0; in fact, I’m pushing that up my todo list.

Could you confirm:

  1. The version of the PHP you’re using (sorry I wasn’t clear by your reference to PHP 7 if you mean that’s the version you’re running)

  2. Your hosting provider. It may be worth asking them about enabling this on your instance(s). The function is a supported function in PHP 7.*.

Thanks.

Thanks @angus . Weird thing is, it didn’t show on the previous production site, it only appeared on the staging (so, full copy). I confirm PHP is 7.4.11, hosting provider is Kinsta. I’ll check with them. Thanks!

1 Like

Hey @Romain_Bisseret, just a note that removing the use of libxml_disable_entity_loader is on my agenda for April (i.e. by the end of the month) as part of a PHP 8.0 compatibility review.

Thanks @angus ! In the meantime, the hosting company agreed to enable it for a short period on my account.

1 Like