<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Fix libxml2 2.12.x build issues.
https://github.com/php/php-src/commit/8a95e616b91ac0eeedba90a61e36e652919763f2
https://github.com/php/php-src/commit/0a39890c967aa57225bb6bdf4821aff7a3a3c082
--- a/ext/dom/document.c	2020-09-30 00:15:55.000000000 -0500
+++ b/ext/dom/document.c	2024-05-19 14:58:38.000000000 -0500
@@ -27,6 +27,7 @@
 #if HAVE_LIBXML &amp;&amp; HAVE_DOM
 #include "php_dom.h"
 #include &lt;libxml/SAX.h&gt;
+#include &lt;libxml/xmlsave.h&gt;
 #ifdef LIBXML_SCHEMAS_ENABLED
 #include &lt;libxml/relaxng.h&gt;
 #include &lt;libxml/xmlschemas.h&gt;
--- a/ext/libxml/libxml.c	2019-10-22 11:59:42.000000000 -0500
+++ b/ext/libxml/libxml.c	2024-05-19 15:08:42.000000000 -0500
@@ -477,7 +477,11 @@
 	return 1;
 }
 
-static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
+#if LIBXML_VERSION &gt;= 21200
+static void _php_list_set_error_structure(const xmlError *error, const char *msg)
+#else
+static void _php_list_set_error_structure(xmlError *error, const char *msg)
+#endif
 {
 	xmlError error_copy;
 	int ret;
@@ -728,7 +732,11 @@
 	va_end(args);
 }
 
+#if LIBXML_VERSION &gt;= 21200
+PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, const xmlError *error)
+#else
 PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, xmlErrorPtr error)
+#endif
 {
 	_php_list_set_error_structure(error, NULL);
 
@@ -1006,9 +1014,7 @@
    Retrieve last error from libxml */
 static PHP_FUNCTION(libxml_get_last_error)
 {
-	xmlErrorPtr error;
-
-	error = xmlGetLastError();
+	const xmlError *error = xmlGetLastError();
 
 	if (error) {
 		object_init_ex(return_value, libxmlerror_class_entry);
--- a/ext/libxml/php_libxml.h	2020-09-30 00:15:53.000000000 -0500
+++ b/ext/libxml/php_libxml.h	2024-05-19 14:58:38.000000000 -0500
@@ -39,6 +39,7 @@
 
 #include "zend_smart_str.h"
 #include &lt;libxml/tree.h&gt;
+#include &lt;libxml/parser.h&gt;
 
 #define LIBXML_SAVE_NOEMPTYTAG 1&lt;&lt;2
 
</pre></body></html>