Use of undefined constant LIBXML_HTML_NOIMPLIED

2019-07-08 10:23发布

问题:

I have just deployed some DOM Manipulation code to our staging server and am getting the error:

[PHP notice] Use of undefined constant LIBXML_HTML_NOIMPLIED - assumed 'LIBXML_HTML_NOIMPLIED'

I have no issues on my desktop using WAMP and cannot find any modules that appear to be related.

Our Centos 6 server appears to be using PHP version 5.4.34 with libxml2-2.7.6-1 installed.

I have searched our php.ini file and there is no mention of 'libxml' and phpinfo() gives me the following section for lib_xml:

libxml

libXML support => active
libXML Compiled Version => 2.7.6
libXML Loaded Version => 20706
libXML streams => enabled

Why would this constant be undefined?

回答1:

Your libxml version is almost there:

From http://php.net/manual/en/libxml.constants.php#constant.libxml-html-noimplied:

Only available in Libxml >= 2.7.7