[PHP-users 3181] iconv が正しく組み込めません

Moriyoshi Koizumi php-users@php.gr.jp
Tue, 30 Oct 2001 12:29:27 +0900


初めて投稿します、小泉 守義と申します。

※小泉さんという方がすでに似たような内容でMLの方に投稿されているみたいなので
お気をつけください。

過去のML投稿を見た限り、同じような問題で困っている方がいらっしゃいましたが、
それでも問題が解消しそうにないので質問します。

さて、コード中でiconv()を使うと


Fatal error: Call to undefined function: iconv() in xxxxxx test.php on line 2


というエラーがでて困っています。

そこで、
<?php phpinfo(); ?>
とすると、
------------------------------------------------------------------------------
                                     iconv
                 iconv support                            enabled

            Directive                 Local Value          Master Value
iconv.input_encoding                   ISO-8859-1           ISO-8859-1
iconv.internal_encoding                ISO-8859-1           ISO-8859-1
iconv.output_encoding                  ISO-8859-1           ISO-8859-1
------------------------------------------------------------------------------
と出てきます。

仕方がないので、現在
popen("echo -n \"string\" /usr/bin/iconv -f $from_code -t $to_code",'r' )
などとして応急処置しています。

コンパイル時のオプションは

----------------------------------------------------

./configure \
--prefix=/usr/local/php \
--exec-prefix=/usr/local/php \
--sysconfdir=/etc/php \
--enable-gd-native-ttf \
--with-layout=GNU \
--with-config-file-path=/etc/php \
--with-bz2 \
--with-zlib \
--with-zlib-dir=/usr \
--with-openssl \
--with-gd=shared,/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir=/usr \
--with-iconv=/usr \
--with-java=/usr/java/jdk1.3.1_01 \
--with-mysql=/usr \
--with-apxs \
--with-expat

----------------------------------------------------
なお、iconvのバージョンは1.7です。

関係ないとは思いますが、
gd 2.0.1を入れるために一部 ${top_srcdir}/configure のgdチェック部分と
${top_srcdir}/ext/gd/gd.c の #define USE_GDIOCTX 付近を書き換えてあります。

なにかお気づきの点あればお願いします。