标签为 "make" 的存档

PHP安装时libiconv错误问题解决

/var/tools/php-5.6.17/ext/iconv/iconv.c:2512: undefined reference to `libiconv_open’
ext/xmlrpc/libxmlrpc/encodings.o: In function `convert’:
/var/tools/php-5.6.17/ext/xmlrpc/libxmlrpc/encodings.c:73: undefined reference to `libiconv_open’
/var/tools/php-5.6.17/ext/xmlrpc/libxmlrpc/encodings.c:81: undefined reference to `libiconv’
/var/tools/php-5.6.17/ext/xmlrpc/libxmlrpc/encodings.c:101: undefined reference to `libiconv_close’
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

在阿里云安装php时,make的时候,发生了libiconv错误,通过安装libiconv,指定with-iconv-dir也没解决。最终是在make时加了一个参数,然后顺利编译通过的。
make ZEND_EXTRA_LIBS='-liconv'

[libiconv_open]collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] 错误 1

编译php时出现错误

xmlrpc/libxmlrpc/encodings.c:73: undefined reference to `libiconv_open'
xmlrpc/libxmlrpc/encodings.c:81: undefined reference to `libiconv'
xmlrpc/libxmlrpc/encodings.c:101: undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] 错误 1

是由于没有安装 libiconv包,又没有yum源,无法通过yum直接安装,还需要自己手动来。
先安装libiconv:

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

然后重新configure php,再make就ok..

./configure --with-iconv=/usr/local
make clean
make