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

CentOs安装PHP在make时报错:

root@---- [/opt/php-5.2.17]# make
/bin/sh /opt/php-5.2.17/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/dom/ -I/opt/php-5.2.17/ext/dom/ -DPHP_ATOM_INC -I/opt/php-5.2.17/include -I/opt/
php-5.2.17/main -I/opt/php-5.2.17 -I/opt/php-5.2.17/ext/date/lib -I/opt/xml2/include/libxml2 -I/opt/php-5.2.17/TSRM -I/opt/php-5.2.17/Zend -I/usr/include -g -O2 -c
/opt/php-5.2.17/ext/dom/node.c -o ext/dom/node.lo
/opt/php-5.2.17/ext/dom/node.c: In function â€کdom_canonicalization’:
/opt/php-5.2.17/ext/dom/node.c:1953: error: dereferencing pointer to incomplete type
/opt/php-5.2.17/ext/dom/node.c:1955: error: dereferencing pointer to incomplete type
make: *** [ext/dom/node.lo] Error 1

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

# curl -o php-5.x.x.patchhttps://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
再次编译即可。

你可能感兴趣的:(php安装错误 (node.c:1953:error) 解决办法)