PHP5.2.5のインストール時に発生するエラーiconvの件を解決


PHP5.2.5のインストール時にエラーが発生。

最初に行なったコマンドはこれ。

# ./configure --enable-mbregex --with-sqlite --with-zlib=/usr \
--with-gd --with-jpeg-dir=/usr --with-freetype-dir=/usr --with-ttf \
--with-png-dir=/usr --enable-gd-native-ttf --enable-gd-jis-conv \
--with-zlib --with-zlib-dir --enable-mbstring \
--with-iconv --with-apxs2=/usr/local/apache2/bin/apxs

# make
# make install



エラーはこれ。

/usr/local/src/php-5.2.5/ext/iconv/iconv.c:2491: undefined reference to `libiconv_open'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] エラー 1



なんだかよく分からないが「iconv」辺りでエラーが発生しているのが理解できた。

Googleで検索してみると、最初に以下のサイトが見つかった。



■PHP5ビルド時のundefined reference to `libiconv’エラーについて

http://oshiete1.goo.ne.jp/qa2149566.html



細かい意味はわからんが、iconvの自動判定がおなしく、

/usr/local/include/iconv.hを削除と上手くいくと書いてある。



iconv.hを移動させ、再度make開始・・・失敗。





再度ググッてみたら、以下のサイトが見つかった。



■さむーい。

http://ayd.jp/p_blog/archive-200711/article-1195754575.html



同じようにエラーが発生し、makeのオプションで解決している。

では私も実行してみる。

make ZEND_EXTRA_LIBS='-liconv'

エラーも出ずに成功!



じゃ、そんな感じで。

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <img localsrc="" alt="">

Comments links could be nofollow free.