ID: 32244 Updated by: [EMAIL PROTECTED] Reported By: wellswang at auo dot com -Status: Open +Status: Feedback Bug Type: ICONV related Operating System: FreeBSD 5.3 PHP Version: 5.0.3 New Comment:
Please run this code: <?php var_dump(get_extension_funcs("iconv")); ?> and paste the output here. Previous Comments: ------------------------------------------------------------------------ [2005-03-09 07:23:25] wellswang at auo dot com i found my problem is same as Bug #12443 but my php version is 5.0.3 .... i don't know how to solve it i use his script to check : <?php $exists_iconv_get_encoding = function_exists('iconv_get_encoding'); $exists_iconv = function_exists('iconv'); if ($exists_iconv_get_encoding == TRUE) { echo "iconv_get_encoding is declared<br>"; } else { echo "iconv_get_encoding is not declared<br>"; } if ($exists_iconv == TRUE) { echo "iconv is declared<br>"; } else { echo "iconv is not declared<br>"; } $test_string = "this is an ascii-only test string"; echo "test_string is: $test_string<br>"; $encoding = iconv_get_encoding($test_string); echo "encoding is: $encoding<br>"; $result = iconv($encoding,'UTF-8',$test_string); echo "result is: $result<br>"; ?> and got the same result as Bug #12443: iconv_get_encoding is declared iconv is not declared test_string is: this is an ascii-only test string encoding is: Fatal error: Call to undefined function iconv() in /http/document/root_osa/temp/foo.php on line 24 ------------------------------------------------------------------------ [2005-03-09 07:15:43] wellswang at auo dot com Description: ------------ enabled iconv extension but got "undefined function iconv()" error I build php5.0.3 on my freebsd 5.3 box, My configure command is: './configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--with-bz2' '--enable-calendar' '--with-zlib' '--enable-ftp' '--with-gd' '--enable-mbstring' '--with-mysql=/usr/local' '--with-mysqli' '--enable-sqlite-utf8' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-spl' '--with-regex=php' '--with-apxs2=/usr/local/sbin/apxs' '--prefix=/usr/local' 'i386-portbld-freebsd5.3' '--with-xmlrpc' '--with-iconv-dir=/usr/local/lib' It say's configured without error: ......... checking for iconv support... yes checking for iconv... (cached) yes checking if iconv is glibc's... no checking if iconv supports errno... no ......... checking whether libxml build works... (cached) yes checking for XMLRPC-EPI support... yes checking libexpat dir for XMLRPC-EPI... no checking iconv dir for XMLRPC-EPI... /usr/local/lib checking for libiconv in -liconv... (cached) yes ......... By using php -i or phpinfo() ,i got : iconv iconv support => enabled iconv implementation => unknown iconv library version => unknown 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 I donot know the meaning of "unknown" but iconv support is enabled ?! ====================== When I use iconv() in my php program, I got error message such as : Fatal error: Call to undefined function iconv() in /http/document/root_osa/classes/blog_function.php on line 683 is it a php bug or my config problem ? Reproduce code: --------------- configure command : './configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--with-bz2' '--enable-calendar' '--with-zlib' '--enable-ftp' '--with-gd' '--enable-mbstring' '--with-mysql=/usr/local' '--with-mysqli' '--enable-sqlite-utf8' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-spl' '--with-regex=php' '--with-apxs2=/usr/local/sbin/apxs' '--prefix=/usr/local' 'i386-portbld-freebsd5.3' '--with-xmlrpc' '--with-iconv-dir=/usr/local/lib' in php file: <?php echo iconv("ISO-8859-1", "UTF-8", "This is a test."); ?> Expected result: ---------------- This is a test. Actual result: -------------- Fatal error: Call to undefined function iconv() in /http/document/root_osa/test.php on line 2 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32244&edit=1