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 到系統(tǒng)中時要是發(fā)生「undefined reference to libiconv_open'」之類的錯誤信息,那表示在「./configure 」沒抓好一些環(huán)境變數(shù)值。錯誤發(fā)生點(diǎn)在建立「-o sapi/cli/php」是出錯,沒給到要 link 的 iconv 函式庫參數(shù)。 解決方法:編輯Makefile 大約77 行左右的地方: EXTRA_LIBS = ..... -lcrypt 在最后加上 -liconv,例如: EXTRA_LIBS = ..... -lcrypt -liconv 然后重新再次 make 即可。
或者用另一種辦法
建立軟鏈接
ln -s /usr/local/lib/libiconv.so.2 /usr/lib64/
再執(zhí)行Make
make ZEND_EXTRA_LIBS='-liconv'