2010-09-10 117 views
2

我試圖重新編譯PHP 5.3.3在Mac OS雪豹經過iconv並得到以下錯誤:在mac os snow leopard上編譯PHP 5.3.3。與發行的iconv聯

Undefined symbols: 
    "_libiconv_open", referenced from: 
     _php_iconv_string in iconv.o 
     __php_iconv_strlen in iconv.o 
     __php_iconv_substr in iconv.o 
     __php_iconv_substr in iconv.o 
     __php_iconv_strpos in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     __php_iconv_mime_decode in iconv.o 
     __php_iconv_mime_decode in iconv.o 
     _php_iconv_stream_filter_ctor in iconv.o 
    "_libiconv", referenced from: 
     __php_iconv_appendl in iconv.o 
     __php_iconv_appendl in iconv.o 
     _php_iconv_string in iconv.o 
     _php_iconv_string in iconv.o 
     __php_iconv_strlen in iconv.o 
     __php_iconv_substr in iconv.o 
     __php_iconv_strpos in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     _php_iconv_stream_filter_append_bucket in iconv.o 
     _php_iconv_stream_filter_append_bucket in iconv.o 
     _php_iconv_stream_filter_append_bucket in iconv.o 
    (maybe you meant: __libiconv_version) 
    "_libiconv_close", referenced from: 
     _php_iconv_string in iconv.o 
     __php_iconv_strlen in iconv.o 
     __php_iconv_substr in iconv.o 
     __php_iconv_substr in iconv.o 
     __php_iconv_strpos in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     __php_iconv_mime_encode in iconv.o 
     __php_iconv_mime_decode in iconv.o 
     __php_iconv_mime_decode in iconv.o 
     __php_iconv_mime_decode in iconv.o 
     _php_iconv_stream_filter_dtor in iconv.o 

我知道這是老問題了,我無法找到合適的解決方案谷歌。

任何想法如何解決它將不勝感激。

我使用:

./configure --prefix=/usr/local/php5 --with-iconv=/usr/local --with-apxs2=/usr/sbin/apxs --enable-pdo --with-gd=/usr/local --with-zlib --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-libxml-dir=/usr/local --with-curl --with-mcrypt --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-mhash --with-libxml-dir=/usr/local --with-t1lib=/usr/local --with-xsl --with-freetype-dir=/usr/local --with-gettext --with-bz2=/usr --with-openssl=/usr/local/ssl --enable-bcmath --enable-calendar --enable-cgi --enable-exif --enable-ftp --enable-gd-native-ttf --enable-mbstring --enable-soap --enable-sqlite-utf8 --enable-cli --enable-wddx --enable-zip 

而且我已經重新編譯libiconv的1.13.1爲好。

+0

沒有你的答案,但我正在解決同樣的問題。到目前爲止,我已經嘗試修補iconv(fabien.potencier.org/article/37/php-5-3-0-on-mac-os-10-6-snow-leopard中的說明)並編輯iconv.c文件(在bill.eccles.net/bills_words/2010/01/building-a-mac-os-x-server-106.html上的說明)我仍然看到相同的錯誤。如果您找到任何其他答案,請告知我。我會回覆相同的。謝謝。 – 2011-02-06 21:24:32

+0

不確定,但我提交了一個錯誤報告,可能會有所幫助,因爲我認爲如果您刪除openssl支持,它會起作用。也許。我們會看到會發生什麼,希望5.3.4能找到解決方案。 – 2011-02-06 21:24:45

+0

嘗試php 5.3.5 也許5.3.3錯誤 – 2011-02-06 21:25:14

回答

0

這是在Mac OS X上編譯PHP的一類問題之一,涉及多個版本的庫--PHP開發人員的響應幾乎總是「只刪除額外的庫,解決了問題」 - 完全忽略了事實上,經常有相當合法的原因安裝了多個庫。他們拒絕解決這個問題。

這篇文章:http://blog.yimingliu.com/2009/02/24/missing-library-symbols-while-compiling-php-528/

覆蓋的libxml的情況下,但它是一個類似的問題。

+0

1. PHP不編譯它被解釋。 2.可能有多個PHP版本並排居住。只要確保Web服務器正在使用您認爲應該使用的那個。即正確的路徑/'php.ini'文件 – 2012-12-04 23:52:29

2

Hola!我在php 5.3.3和php 5.3.5上都遇到同樣的問題。我的錯誤,這樣寫對5.3.5

Undefined symbols: 
    "_libiconv", referenced from: 
     __php_iconv_strlen in iconv.o 
     _php_iconv_string in iconv.o 
     _php_iconv_string in iconv.o 
     __php_iconv_strpos in iconv.o 
     __php_iconv_appendl in iconv.o 
     __php_iconv_appendl in iconv.o 
     _zif_iconv_substr in iconv.o 
     _zif_iconv_mime_encode in iconv.o 
     _zif_iconv_mime_encode in iconv.o 
     _zif_iconv_mime_encode in iconv.o 
     _zif_iconv_mime_encode in iconv.o 
     _zif_iconv_mime_encode in iconv.o 
     _zif_iconv_mime_encode in iconv.o 
     _php_iconv_stream_filter_append_bucket in iconv.o 
     _php_iconv_stream_filter_append_bucket in iconv.o 
    (maybe you meant: __libiconv_version) 
ld: symbol(s) not found 
collect2: ld returned 1 exit status 
make: *** [libs/libphp5.bundle] Error 1 

解決的辦法是改變的文件轉/的iconv/iconv.c

打開它,並改變周圍的管線185看起來像這樣

  • 的#if定義(HAVE_LIBICONV)& &定義(ICONV_ALIASED_LIBICONV)
  • 的#define的iconv的iconv
  • #ENDIF

基本改變 「libiconv的」 公正 「的iconv」

該解決方案爲我工作在兩個PHP 5.3.3和5.3.5的雪豹10.6.4

和平

+0

這對我有用。謝謝! – MZAweb 2012-03-12 10:26:23

相關問題