# Error msg libxml\_disable\_entity\_loader

**URL:** https://meta.discourse.org/t/error-msg-libxml-disable-entity-loader/185883
**Category:** WordPress
**Created:** [April 7, 2021, 1:19pm UTC](https://meta.discourse.org/t/error-msg-libxml-disable-entity-loader/185883 "2021-04-07T13:19:57Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Romain\_Bisseret](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/romain_bisseret/32/199904_2.png) [@Romain\_Bisseret](https://meta.discourse.org/u/Romain_Bisseret)
#### Post date: [April 7, 2021, 1:19pm UTC](https://meta.discourse.org/t/error-msg-libxml-disable-entity-loader/185883/1 "2021-04-07T13:19:57Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Romain\_Bisseret](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/romain_bisseret/32/199904_2.png) [@Romain\_Bisseret](https://meta.discourse.org/u/Romain_Bisseret)
#### Post date: [April 8, 2021, 6:50pm UTC](https://meta.discourse.org/t/error-msg-libxml-disable-entity-loader/185883/2 "2021-04-08T18:50:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 8, 2021, 7:32pm UTC](https://meta.discourse.org/t/error-msg-libxml-disable-entity-loader/185883/3 "2021-04-08T19:32:51Z")

</div>

Maybe @angus can help?

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 8, 2021, 10:56pm UTC](https://meta.discourse.org/t/error-msg-libxml-disable-entity-loader/185883/4 "2021-04-08T22:56:55Z")

</div>

Hey @Romain_Bisseret,

The issue here is arising because your hosting provider has disabled a PHP function called [` libxml_disable_entity_loader`](https://www.php.net/manual/en/function.libxml-disable-entity-loader.php), which is used in the [WP Discourse](https://github.com/discourse/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](https://github.com/discourse/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.

---

<div class="post-metadata">

### Author: ![Romain\_Bisseret](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/romain_bisseret/32/199904_2.png) [@Romain\_Bisseret](https://meta.discourse.org/u/Romain_Bisseret)
#### Post date: [April 9, 2021, 9:00am UTC](https://meta.discourse.org/t/error-msg-libxml-disable-entity-loader/185883/5 "2021-04-09T09:00:49Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [April 11, 2021, 11:36pm UTC](https://meta.discourse.org/t/error-msg-libxml-disable-entity-loader/185883/6 "2021-04-11T23:36:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Romain\_Bisseret](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/romain_bisseret/32/199904_2.png) [@Romain\_Bisseret](https://meta.discourse.org/u/Romain_Bisseret)
#### Post date: [April 12, 2021, 6:44am UTC](https://meta.discourse.org/t/error-msg-libxml-disable-entity-loader/185883/7 "2021-04-12T06:44:41Z")

</div>

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