undefined reference to `libiconv_open 無法編譯PHP libiconv
./configure --with-mysql=/backup/mysql --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-curl --with-gd --enable-gd-native-ttf --with-apxs2=/usr/local/apache/bin/apxs --enable-sockets --with-iconv
make時提示:
.....................................................
ext/iconv/.libs/iconv.o(.text+0x1738): In function `zif_iconv_mime_encode':
/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1017: undefined reference to `libiconv_open'
ext/iconv/.libs/iconv.o(.text+0x1756):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1031: undefined reference to `libiconv_open'
ext/iconv/.libs/iconv.o(.text+0x1993):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1290: undefined reference to `libiconv_close'
ext/iconv/.libs/iconv.o(.text+0x19ad):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1293: undefined reference to `libiconv_close'
ext/iconv/.libs/iconv.o(.text+0x1b01):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1102: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o(.text+0x1b33):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1134: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o(.text+0x1b5e):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1150: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o(.text+0x1e10):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1202: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o(.text+0x1e3c):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1233: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o(.text+0x207f):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:1277: more undefined references to `libiconv' follow
ext/iconv/.libs/iconv.o(.text+0x2c08): In function `php_iconv_stream_filter_dtor':
/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:2393: undefined reference to `libiconv_close'
ext/iconv/.libs/iconv.o(.text+0x2cf2): In function `php_iconv_stream_filter_append_bucket':
/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:2543: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o(.text+0x2d34):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:2543: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o(.text+0x2de7):/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:2465: undefined reference to `libiconv'
ext/iconv/.libs/iconv.o(.text+0x30e2): In function `php_iconv_stream_filter_factory_create':
/home/jjdai/work/zhupiter/php-5.2.0/ext/iconv/iconv.c:2419: undefined reference to `libiconv_open'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
解決方法:
#wget />
#tar -zxvf libiconv-1.13.1.tar.gz
#cd libiconv-1.13.1
# ./configure --prefix=/usr/local/libiconv
# make
# make install
再檢查php,指定 iconv的位置 --with-iconv=/usr/local/libiconv
#./configure --with-mysql=/backup/mysql --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-curl --with-gd --enable-gd-native-ttf --with-apxs2=/usr/local/apache/bin/apxs --enable-sockets --with-iconv=/usr/local/libiconv
#make
#make install
另一種解決方法為去除iconv模組也能正常編譯php,如下:
編輯 Makefile 大約 77 行左右的地方:
EXTRA_LIBS = ..... -lcrypt
在最後加上 -liconv,例如:
EXTRA_LIBS = ..... -lcrypt -liconv
再執行make就可以了。
- 本人實驗方法二後,重啟httpd服務會報以下的錯誤,推薦使用第三種方法,可以解決
-
- httpd: Syntax error on line 57 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol: libiconv_open
最後一種方法:由tonyty163提供:
#make ZEND_EXTRA_LIBS='-liconv'
#make install
版權宣告:本文為博主原創文章,未經博主允許不得轉載。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29096438/viewspace-1789541/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- sphinx :undefined reference to `libiconv' 報錯解決辦法Undefined
- A20核心編譯錯誤undefined reference to `hwmon_device_register編譯Undefineddev
- undefined reference toUndefined
- Linux make編譯報錯:undefined reference to `vtable for XXX 'Linux編譯Undefined
- libiconv-1.16編譯編譯
- Qt undefined reference to ***QTUndefined
- undefined reference to `__isnanf'UndefinedNaN
- "undefined reference to" 問題解決方法Undefined
- undefined reference to錯誤的解決方法Undefined
- PHP編譯錯誤及解決辦法PHP編譯
- PHP編譯安裝時常見錯誤解決辦法,php編譯常見錯誤PHP編譯
- PHP提示Notice: Undefined variable的解決辦法PHPUndefined
- VS 按F5無法自動編譯編譯
- 執行無法解決的編譯錯誤編譯
- Eclipse無法編譯 build無效 沒有class檔案Eclipse編譯UI
- Qt 訊號發射部分 undefined reference to錯誤QTUndefined
- codeblocks處理undefined reference to `pthread_create'BloCUndefinedthread
- php編譯引數PHP編譯
- PHP編譯選項PHP編譯
- php追加編譯imagickPHP編譯
- qt編譯報錯 無法執行“rc.exe”QT編譯
- matlab中出現mex無法編譯的問題Matlab編譯
- Linux下使用nm命令排查和解決“undefined reference to ”LinuxUndefined
- C++:與C混合程式設計 CMake undefined reference toC++程式設計Undefined
- 譯|There Are No Reference Types in GoGo
- 編譯無效物件編譯物件
- Xamarin.iOS編譯時無法連線蘋果系統iOS編譯蘋果
- 儲存過程被鎖無法編譯的解決儲存過程編譯
- centos PHP 編譯安裝CentOSPHP編譯
- httpd編譯安裝phphttpd編譯PHP
- PHP的編譯安裝PHP編譯
- 讓sublime編譯php、js編譯PHPJS
- php編譯小錯誤PHP編譯
- 編譯PHP的錯誤編譯PHP
- PLSQL Language Reference-PL/SQL語言基礎-條件編譯-條件編譯指令限制SQL編譯
- PLSQL Language Reference-PL/SQL語言基礎-條件編譯-條件編譯舉例SQL編譯
- g++連結報錯:undefined reference to typeinfo of xxxUndefined
- apache continuum build maven2 專案 無法編譯classApacheUIMaven編譯