栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

php安装错误 node.c:1953 解决办法

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

php安装错误 node.c:1953 解决办法

php5.2.17 make时报错:

/usr/local/src/php-5.2.17/ext/dom/node.c: In function ‘dom_canonicalization’:

/usr/local/src/php-5.2.17/ext/dom/node.c:1953:21: error: dereferencing pointer to incomplete type

    ret = buf->buffer->use;

                     ^

In file included from /usr/local/src/php-5.2.17/main/php.h:38:0,

                 from /usr/local/src/php-5.2.17/ext/dom/node.c:26:

/usr/local/src/php-5.2.17/ext/dom/node.c:1955:40: error: dereferencing pointer to incomplete type

     RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);

                                        ^

/usr/local/src/php-5.2.17/Zend/zend_API.h:472:14: note: in definition of macro ‘ZVAL_STRINGL’

   char *__s=(s); int __l=l;  

              ^

/usr/local/src/php-5.2.17/ext/dom/node.c:1955:5: note: in expansion of macro ‘RETVAL_STRINGL’

     RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);

     ^

make: *** [ext/dom/node.lo] Error 1

在国外的一个网站上找到了这个,其他版本的php也同样适用。

# curl -o php-5.x.x.patch https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
# cd php-5.x.x
# patch -p0 -b < ./php-5.x.x.patch 

   patching file ext/dom/node.c

   patching file 

   ext/dom/documenttype.c

   patching file ext/simplexml/simplexml.c

再次编译即可。

https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt内容:

#########

--- ext/dom/node.c	2012-08-06 17:49:48.826716692 +0800+++ ext/dom/node.c	2012-08-06 17:52:47.633484660 +0800@@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNA         RETVAL_FALSE;     } else { 		if (mode == 0) {+#ifdef LIBXML2_NEW_BUFFER+            ret = xmlOutputBufferGetSize(buf);+#else 			ret = buf->buffer->use;+#endif 			if (ret > 0) {+#ifdef LIBXML2_NEW_BUFFER+                RETVAL_STRINGL((char *) xmlOutputBufferGetContent(buf), ret, 1);+#else 				RETVAL_STRINGL((char *) buf->buffer->content, ret, 1);+#endif 			} else { 				RETVAL_EMPTY_STRING(); 			}--- ext/dom/documenttype.c	2012-08-06 18:02:16.019640870 +0800+++ ext/dom/documenttype.c	2012-08-06 18:06:16.612228905 +0800@@ -205,7 +205,13 @@ int dom_documenttype_internal_subset_rea 		if (buff != NULL) { 			xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL); 			xmlOutputBufferFlush(buff);++#ifdef LIBXML2_NEW_BUFFER+			ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff),+			             xmlOutputBufferGetSize(buff), 1);+#else 			ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);+#endif 			(void)xmlOutputBufferClose(buff); 			return SUCCESS; 		}--- ext/simplexml/simplexml.c	2012-08-06 18:10:44.621017026 +0800+++ ext/simplexml/simplexml.c	2012-08-06 18:12:48.016270419 +0800@@ -1417,7 +1417,12 @@ SXE_METHOD(asXML)  			xmlNodeDumpOutput(outbuf, (xmlDocPtr) sxe->document->ptr, node, 0, 0, ((xmlDocPtr) sxe->document->ptr)->encoding); 			xmlOutputBufferFlush(outbuf);+#ifdef LIBXML2_NEW_BUFFER+			RETVAL_STRINGL((char *)xmlOutputBufferGetContent(outbuf),+			               xmlOutputBufferGetSize(outbuf), 1);+#else 			RETVAL_STRINGL((char *)outbuf->buffer->content, outbuf->buffer->use, 1);+#endif 			xmlOutputBufferClose(outbuf); 		} 	} else {

#########

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/228062.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号