2008년 1월 9일 수요일

CentOS5 (RedHat Linux 5) 에서 구버전 PHP 컴파일 하기

OS 버전이 올라감에 따라서 GCC 라든지 GLIBC 버전도 올라가기 때문에과거 버전의 소스 컴파일이 불가능할때가 있다.
예를 들어 php-5.0.2 를 최신 CentOS5 에서 컴파일 하면 다음과 같은 에러가 나는데

makegcc -Iext/libxml/ -I/home/contehm/mydownloads/php-5.0.3/ext/libxml/ -DPHP_ATOM_INC -I/home/contehm/mydownloads/php-5.0.3/include -I/home/contehm/mydownloads/php-5.0.3/main -I/home/contehm/mydownloads/php-5.0.3 -I/home/contehm/mydownloads/php-5.0.3/Zend -I/usr/include/libxml2 -I/home/contehm/mydownloads/php-5.0.3/TSRM -g -O2 -c /home/contehm/mydownloads/php-5.0.3/ext/libxml/libxml.c -o ext/libxml/libxml.o && echo > ext/libxml/libxml.loIn file included from /home/contehm/mydownloads/php-5.0.3/Zend/zend_API.h:26,from /home/contehm/mydownloads/php-5.0.3/main/php.h:38,from /home/contehm/mydownloads/php-5.0.3/ext/libxml/libxml.c:28:/home/contehm/mydownloads/php-5.0.3/Zend/zend_modules.h:34: error: array type has incomplete element type/home/contehm/mydownloads/php-5.0.3/Zend/zend_modules.h:35: error: array type has incomplete element type/home/contehm/mydownloads/php-5.0.3/Zend/zend_modules.h:36: error: array type has incomplete element type/home/contehm/mydownloads/php-5.0.3/Zend/zend_modules.h:37: error: array type has incomplete element type/home/contehm/mydownloads/php-5.0.3/Zend/zend_modules.h:38: error: array type has incomplete element typemake: *** [ext/libxml/libxml.lo] Error 1
다음과 같이 처리 한다.
../Zend/zend_modules.h 에 #include "zend_compile.h" 추가

#include "zend.h"
#include "zend_compile.h"
#define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC

#define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC

댓글 없음: