x64平台的一些问题

在x64位机器上使用libxml动态库时,发现从源码安装php时候老是make不上,即时指定libxml的安装路径也是无效果,make错误如下
ext/libxml/.libs/libxml.o(.text+0x555): In function `_php_libxml_free_error':
/home/lijunlia/opt/src/php-5.2.5/ext/libxml/libxml.c:441: undefined reference to `xmlResetError'
ext/libxml/.libs/libxml.o(.text+0x5a9): In function `_php_list_set_error_structure':
/home/lijunlia/opt/src/php-5.2.5/ext/libxml/libxml.c:455: undefined reference to `xmlCopyError'
ext/libxml/.libs/libxml.o(.text+0xf6a): In function `zm_activate_libxml':
/home/lijunlia/opt/src/php-5.2.5/ext/libxml/libxml.c:651: undefined reference to `xmlParserInputBufferCreateFilenameDefault'
ext/libxml/.libs/libxml.o(.text+0xf76):/home/lijunlia/opt/src/php-5.2.5/ext/libxml/libxml.c:652: undefined reference to `xmlOutputBufferCreateFilenameDefault'
...
/home/lijunlia/opt/src/php-5.2.5/ext/xmlwriter/php_xmlwriter.c:1523: undefined reference to `xmlNewTextWriterMemory'
ext/xmlwriter/.libs/php_xmlwriter.o(.text+0x1e7d): In function `php_xmlwriter_flush':
/home/lijunlia/opt/src/php-5.2.5/ext/xmlwriter/php_xmlwriter.c:1581: undefined reference to `xmlTextWriterFlush'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
进入libxml安装目录,直接查看lib库中是否有xmlTextWriterFlush这个引用:
$nm libxml2.so |grep xmlTextWriterFlush
00000000000f3060 T xmlTextWriterFlush
为什么有上面这个错误呢?查了好久,发现x64的平台寻找lib时,首先会寻找/usr/lib64这个目录,我发现这个目录里面有一个libxml2.so,是一个老版本,导致一些东西没有定义:
$nm libxml2.so.2.5.10  |grep xmlTextWriterFlush
nm: libxml2.so.2.5.10: no symbols
$nm libxml2.so.2.6.30 |grep xmlTextWriterFlush
00000000000f3060 T xmlTextWriterFlush
郁闷了老半天,知道错误后,然后删除lib64目录下的一些老版本的libxml2.so,然后重新configure:
./configure --prefix=/home/lijunlia/opt/usr/local/php --with-apxs2=/home/lijunlia/opt/usr/local/apache2/bin/apxs --with-mysql=/home/lijunlia/opt/usr/local/mysql --with-config-file-path=/home/lijunlia/opt/etc --with-gd --with-zlib --with-jpeg-dir=/usr/local/jpeg --with-libxml-dir=/usr --enable-sockets --with-iconv --enable-mbstring --enable-soap --with-curl --with-freetype-dir=/usr/local --with-pgsql=/home/lijunlia/opt/usr --enable-zend-multibyte
终于出现了:
Build complete.
Don't forget to run 'make test'.
作此笔记,以儆效尤。

Monthly Archives

Pages

Powered by Movable Type 7.7.2

About this Entry

This page contains a single entry by Cnangel published on January 22, 2008 3:15 PM.

关于libjpeg库 was the previous entry in this blog.

关于数学的专业词汇[分享] is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.