ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_dtor':
/home/php-5.5.38/ext/iconv/iconv.c:2516: undefined reference to `libiconv_close'
ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_append_bucket':
/home/php-5.5.38/ext/iconv/iconv.c:2667: undefined reference to `libiconv'
/home/php-5.5.38/ext/iconv/iconv.c:2666: undefined reference to `libiconv'
/home/php-5.5.38/ext/iconv/iconv.c:2588: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_ctor':
/home/php-5.5.38/ext/iconv/iconv.c:2542: undefined reference to `libiconv_open'
ext/xmlrpc/libxmlrpc/.libs/encodings.o: In function `convert':
/home/php-5.5.38/ext/xmlrpc/libxmlrpc/encodings.c:73: undefined reference to `libiconv_open'
/home/php-5.5.38/ext/xmlrpc/libxmlrpc/encodings.c:81: undefined reference to `libiconv'
/home/php-5.5.38/ext/xmlrpc/libxmlrpc/encodings.c:101: undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
[root@test php-5.2.13]# vi Makefile
在安裝 PHP 到系统中时要是发生「undefined reference to libiconv_open'」之类的错误信息,那表示在「./configure 」沒抓好一些环境变数值。错误发生点在建立「-o sapi/cli/php」是出错,没給到要 link 的 iconv 函式库参数。 解决方法:编辑Makefile 大约77 行左右的地方: EXTRA_LIBS = ..... -lcrypt 在最后加上 -liconv,例如: EXTRA_LIBS = ..... -lcrypt -liconv 然后重新再次 make 即可。
或者用另一种办法
建立软链接
ln -s /usr/local/lib/libiconv.so.2 /usr/lib64/
再执行Make
make ZEND_EXTRA_LIBS='-liconv'