0712-2888027 189-8648-0214
微信公众号

孝感风信信息技术有限公司微信公众号

当前位置: 主页 > 技术支持 > Linux > Make编译安装php出现collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1的解决方法

Make编译安装php出现collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1的解决方法

时间:2016-08-07来源:风信网 点击:
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'
栏目列表
推荐内容
热点内容
展开