0712-2888027 189-8648-0214
微信公眾號(hào)

孝感風(fēng)信網(wǎng)絡(luò)科技有限公司微信公眾號(hào)

當(dāng)前位置:主頁(yè) > 技術(shù)支持 > Linux > Make編譯安裝php出現(xiàn)collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1的解決方法

Make編譯安裝php出現(xiàn)collect2: ld returned 1 exit status make: *** [sapi/cli/php] Error 1的解決方法

時(shí)間:2016-08-07來(lái)源:風(fēng)信官網(wǎng) 點(diǎn)擊: 21368次
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)中時(shí)要是發(fā)生「undefined reference to libiconv_open'」之類的錯(cuò)誤信息,那表示在「./configure 」沒(méi)抓好一些環(huán)境變數(shù)值。錯(cuò)誤發(fā)生點(diǎn)在建立「-o sapi/cli/php」是出錯(cuò),沒(méi)給到要 link 的 iconv 函式庫(kù)參數(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'
熱門關(guān)鍵詞: Make編譯 php collect2 ld returne
欄目列表
推薦內(nèi)容
熱點(diǎn)內(nèi)容
展開(kāi)