centos 微软 Firefox java Python mysql nginx wordpress HTML5 Windows linux Android shell 开源 apache google php linux命令 程序员 Ubuntu

PHP5.4.X编译出错”undefined reference to `libiconv_open’”

PHP5.4.x编译出错

ext/iconv/iconv.o: In function `_php_iconv_strlen':
/soft/sources/PHP-5.4.9/ext/iconv/iconv.c:660: undefined reference to `libiconv_open'
/soft/sources/php-5.4.9/ext/iconv/iconv.c:683: undefined reference to `libiconv'
/soft/sources/php-5.4.9/ext/iconv/iconv.c:717: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_appendl':
/soft/sources/php-5.4.9/ext/iconv/iconv.c:401: undefined reference to `libiconv'
/soft/sources/php-5.4.9/ext/iconv/iconv.c:438: undefined reference to `libiconv'
ext/iconv/iconv.o: In function `_php_iconv_substr':
/soft/sources/php-5.4.9/ext/iconv/iconv.c:780: undefined reference to `libiconv_open'
/soft/sources/php-5.4.9/ext/iconv/iconv.c:804: undefined reference to `libiconv'
/soft/sources/php-5.4.9/ext/iconv/iconv.c:859: undefined reference to `libiconv_close'
/soft/sources/php-5.4.9/ext/iconv/iconv.c:863: undefined reference to `libiconv_close'
/soft/sources/php-5.4.9/ext/iconv/iconv.c:812: undefined reference to `libiconv_open'

缺少libiconv库, 下载安装:

 $ wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
 $ tar xzf libiconv-1.14.tar.gz
 $ ./configure --prefix=/soft/lib/libiconv-1.14

wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download

 $ tar zxf php-5.4.x.tar.gz
 $ cd php-5.4.x-src/
 $ ./configure --prefix=/soft/php/php-5.4.x --enable-fpm --with-iconv=/soft/lib/libiconv-1.14

延伸阅读

评论