PHP无法编译undefined reference to `libiconv_open

./configure --prefix=/usr/local/php52

make时提示:
.....................................................
ext/iconv/.libs/iconv.o(.text+0x1738): In function `zif_iconv_mime_encode‘:
/usr/src/php-5.2.0/ext/iconv/iconv.c:1017: undefined reference to `libiconv_open‘
ext/iconv/.libs/iconv.o(.text+0x1756):/usr/src/php-5.2.0/ext/iconv/iconv.c:1031: undefined reference to `libiconv_open‘
ext/iconv/.libs/iconv.o(.text+0x1993):/usr/src/php-5.2.0/ext/iconv/iconv.c:1290: undefined reference to `libiconv_close‘
ext/iconv/.libs/iconv.o(.text+0x19ad):/usr/src/php-5.2.0/ext/iconv/iconv.c:1293: undefined reference to `libiconv_close‘
ext/iconv/.libs/iconv.o(.text+0x1b01):/usr/src/php-5.2.0/ext/iconv/iconv.c:1102: undefined reference to `libiconv‘
ext/iconv/.libs/iconv.o(.text+0x1b33):/usr/src/php-5.2.0/ext/iconv/iconv.c:1134: undefined reference to `libiconv‘
ext/iconv/.libs/iconv.o(.text+0x1b5e):/usr/src/php-5.2.0/ext/iconv/iconv.c:1150: undefined reference to `libiconv‘
ext/iconv/.libs/iconv.o(.text+0x1e10):/usr/src/php-5.2.0/ext/iconv/iconv.c:1202: undefined reference to `libiconv‘
ext/iconv/.libs/iconv.o(.text+0x1e3c):/usr/src/php-5.2.0/ext/iconv/iconv.c:1233: undefined reference to `libiconv‘
ext/iconv/.libs/iconv.o(.text+0x207f):/usr/src/php-5.2.0/ext/iconv/iconv.c:1277: more undefined references to `libiconv‘ follow
ext/iconv/.libs/iconv.o(.text+0x2c08): In function `php_iconv_stream_filter_dtor‘:
/usr/src/php-5.2.0/ext/iconv/iconv.c:2393: undefined reference to `libiconv_close‘
ext/iconv/.libs/iconv.o(.text+0x2cf2): In function `php_iconv_stream_filter_append_bucket‘:
/usr/src/php-5.2.0/ext/iconv/iconv.c:2543: undefined reference to `libiconv‘
ext/iconv/.libs/iconv.o(.text+0x2d34):/usr/src/php-5.2.0/ext/iconv/iconv.c:2543: undefined reference to `libiconv‘
ext/iconv/.libs/iconv.o(.text+0x2de7):/usr/src/php-5.2.0/ext/iconv/iconv.c:2465: undefined reference to `libiconv‘
ext/iconv/.libs/iconv.o(.text+0x30e2): In function `php_iconv_stream_filter_factory_create‘:
/usr/src/php-5.2.0/ext/iconv/iconv.c:2419: undefined reference to `libiconv_open‘
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

解决方法:

#wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
#tar -zxvf libiconv-1.13.1.tar.gz
#cd libiconv-1.13.1
# ./configure --prefix=/usr/local/libiconv
# make
# make install

方法一:法为去除iconv模块也能正常编译php,如下:
編輯 Makefile 大約 77 行左右的地方:
EXTRA_LIBS = ..... -lcrypt
在最後加上 -liconv,例如:
EXTRA_LIBS = ..... -lcrypt -liconv

再检查php,指定 iconv的位置  --with-iconv=/usr/local/libiconv
#./configure --prefix=/usr/local/php52 --with-iconv=/usr/local/libiconv
#make
#make install

再运行make就可以了。

最后一种方法:

#make ZEND_EXTRA_LIBS=‘-liconv‘
#make install

时间: 2024-10-13 12:20:15

PHP无法编译undefined reference to `libiconv_open的相关文章

(笔记)Linux线程编译undefined reference to 'pthread_create'

在使用线程时,使用gcc或arm-linux-gcc编译时,会出现错误:undefined reference to 'pthread_create' 主要是以下两种原因: 1.#include <pthread.h>  请确认头文件是否添加 2.-lpthread 编译选项,即在编译时需添加额外的编译选项,如使用arm-linux-gcc编译lc300-led-test.c文件,命令正确应该如下: arm-linux-gcc -o lc300-led-test lc300-led-test.

undefined reference to `libiconv_open 无法编译PHP

解决方法:#wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz#tar -zxvf libiconv-1.13.1.tar.gz#cd libiconv-1.13.1# ./configure --prefix=/usr/local/libiconv# make# make install 再检查php,指定 iconv的位置  --with-iconv=/usr/local/libiconv#./configure -

在codeblocks 下,C++编译不成功一直出现“undefined reference to `std::cout&#39;|

自己搞了好久才知道,编辑c++,要用g++ 希望对大家有帮助 在codeblocks 下,C++编译不成功一直出现"undefined reference to `std::cout'|

lua-5.2.3编译问题记录&amp;quot;libreadline.so: undefined reference to `PC&amp;#39;&amp;quot;

作者:zhanhailiang 日期:2014-10-21 [root@~/software]# cd lua-5.2.3 [root@~/software/lua-5.2.3]# make linux cd src && make linux make[1]: Entering directory `/root/software/lua-5.2.3/src' make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,

nios ii 13 主程序的函数可以用Open Declaration 查看,但是编译的时候却说 undefined reference to 。。。这是为什么?

在做12864 ip 核试验时,写了三个文件第一个是时序文件QC12864.v第二个是QC12864.H这个文件主要包括声明和宏定义,第三个文件是QC12864.c这个文件包含函数的定义.详细的请看 http://www.cnblogs.com/yuphone/archive/2010/03/25/1694547.html.我出现这个错误后把三个文件和成一个文件编译的时候,编译错误就发生了变化.把原来所指向的错误更加的细化.指向了原来错误那一行所包含的隐含信息.原来我在文件中出现了许多的语法错误

GCC编译uboot出现(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0&#39;错误的解决办法

/opt/arm-2010.09/bin/../lib/gcc/arm-none-linux-gnueabi/4.5.1/armv4t/libgcc.a(_bswapsi2.o):(.ARM.exidx+0x0): undefined reference to `__aeabi_unwind_cpp_pr0' make: *** [u-boot] Error 1 一旦编译uboot出现上述错误,请不要慌张!解决办法官网已经给出,主要解决办法如下: vim 打开./lib_arm/eabi_com

lua-5.2.3编译问题&quot;/usr/local/lib/libreadline.so: undefined reference to `PC&#39;&quot;

作者:zhanhailiang 日期:2014-10-21 [root@~/software]# cd lua-5.2.3 [root@~/software/lua-5.2.3]# make linux cd src && make linux make[1]: Entering directory `/root/software/lua-5.2.3/src' make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,

linux下开发,解决cocos2d-x中编译出现的一个小问题, undefined reference to symbol &amp;#39;[email&#160;protected]@GLIBC_2.2.5&amp;#39;

解决cocos2d-x中编译出现的一个小问题 对于cocos2d-x 2.×中编译中,若头文件里引入了#include "cocos-ext.h",在进行C++编译的时候会遇到例如以下错误: undefined reference to symbol '[email protected]@GLIBC_2.2.5'/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command li

Android编译错误——undefined reference to

[错误描述] 未定义引用 提示如下:bootable/recovery/minzip/Zip.c:1122: error: undefined reference to 'selabel_lookup'bootable/recovery/minzip/Zip.c:1123: error: undefined reference to 'setfscreatecon'bootable/recovery/minzip/Zip.c:1129: error: undefined reference to