php 소스 컴파일시 아래와 같은 오류가 발생하는 경우가 있다. 

gcc 4.7 버전에서 아래와 같은 오류가 발생한다. 

/home/segio_php/php-5.2.17/ext/dom/node.c: In function ‘dom_canonicalization’:
/home/segio_php/php-5.2.17/ext/dom/node.c:1953:21: error: dereferencing pointer to incomplete type
/home/segio_php/php-5.2.17/ext/dom/node.c:1955:5: error: dereferencing pointer to incomplete type



이때는 아래와 같은 순서로 php 소스를 패치하면 오류가 사라진다. 

[root@localhost] wget -O php.patch  https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
[root@localhost] cd php-5.2.17
[root@localhost] patch -p0 -b < php.patch
patching file ext/dom/node.c
Hunk #1 succeeded at 1950 (offset 55 lines).
patching file ext/dom/documenttype.c
Hunk #1 succeeded at 215 (offset 10 lines).
patching file ext/simplexml/simplexml.c
Hunk #1 succeeded at 1343 (offset -74 lines).

patch 명령어를 찾을 수 없다고 할 경우 yum -y install patch

위와 같이 패치를 적용한 후 컴파일을 하면 문제없이 진행된다. 

 

[출처] http://blog.naver.com/ssik425/10175143994