./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..tar.gz
#cd libiconv-1.13.
# ./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

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

  1. CentOS 6.5 编译 PHP-7 报错:undefined reference to `libiconv_open 无法编译 PHP libiconv

    ./configure --with-mysql=/backup/mysql --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zli ...

  2. 安装sphinx报错(undefined reference to `libiconv_open' 、undefined reference to `libiconv'、undefined reference to `libiconv_close'、make[1]: *** No rule to make target `all'. Stop. 、make: *** [all-recursive

    (为知笔记copy过来格式有变,希望对遇到此问题的童鞋有帮助) 具体错误: Thank you for choosing Sphinx! [root@vm-vagrant csft-4.1]# mak ...

  3. undefined reference to libiconv_open'

    ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_ctor': /home/king/php-5.2.13/ext/iconv ...

  4. PHP7编译错误:php编译undefined reference to `libiconv 错误

    ext/gd/libgd/.libs/gdkanji.o: In function `do_convert’: /root/php-5.2.12/ext/gd/libgd/gdkanji.c:350: ...

  5. 安裝 PHP 時出現undefined reference to `libiconv_open’ 之類的錯誤訊息

    在安裝 PHP 到系統中時要是發生「undefined reference to `libiconv_open'」之類的錯誤訊息,那表示在「./configure 」沒抓好一些環境變數值.錯誤發生點在 ...

  6. undefined reference to libiconv_open ext/iconv/.libs/iconv.o by install phpsource

    错误信息:ext/iconv/.libs/iconv.o(.text+0x30e2): In function `php_iconv_stream_filter_factory_create':/ho ...

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

    在使用线程时,使用gcc或arm-linux-gcc编译时,会出现错误:undefined reference to 'pthread_create' 主要是以下两种原因: 1.#include &l ...

  8. 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. ...

  9. codeBlocks编译undefined reference to错误

    是没有把c文件编译进去的原因. 右键项目,选择属性,弹出窗体 然后选择build targets 在最下面有个build target files:中把c文件勾选.点击ok重新编译即可. Code:: ...

随机推荐

  1. BAT command

    http://www.cnblogs.com/SunShineYPH/archive/2011/12/13/2285570.html BAT常用命令 1.@ 它的作用是隐藏它后面这一行的命令本身(只能 ...

  2. C#程序

    using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net ...

  3. 【11-23】window常用知识

    tips msconfig :管理应用程序加载启动项,也可以通过我的计算机查看 service.msc :管理windows本地服务 命令行:net start :显示所有启动的服务,不加分号 net ...

  4. oracle中时间运算

    Oracle两个函数相减,默认得到的是天数,按日期格式,精准到响应的精度,如用sysdate(2015/12/7 10:17:52),时间差精确到秒. 在此基础上,oracle两个时间相减默认天数*2 ...

  5. JQ分页功能

    HTML <div id='page'></div> <div id='con'></div> CSS span{width: 60px;height: ...

  6. Linux下Redis常用命令

    >src/redis-server  启动 Redis 服务  或者>src/redis-server redis.conf src/redis-server redis.conf 1&g ...

  7. PHP CLI下接受参数的几种方法

    PHP CLI(命令行模式下)接受参数有多种方法: (1)使用$argv接受参数 <?php //变量仅在 register_argc_argv 打开时可用. print_r($argc); / ...

  8. UESTC 1852 Traveling Cellsperson

    找规律水题... Traveling Cellsperson Time Limit: 1000ms Memory Limit: 65535KB This problem will be judged ...

  9. PHP读取word文档

    在PHP中读取和写入WORD文档的代码 <? php // 建立一个指向新COM组件的索引 $word = new COM(”word.application”) or die(”Can't s ...

  10. oracle数据库启动

    遇到个白痴问题,放假停电,回来时启动数据库,发现无法进入oracle管理员界面. 如下输入,但是显示的命令无效. [oracle@crm001 database]$ sqlplus / as sysd ...