|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-03-09 07:15 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 04:00:01 2025 UTC |
Please run this code: <?php var_dump(get_extension_funcs("iconv")); ?> and paste the output here.The result is: -------------------------------------------- array(11) { [0]=> string(8) "libiconv" [1]=> string(16) "ob_iconv_handler" [2]=> string(18) "iconv_get_encoding" [3]=> string(18) "iconv_set_encoding" [4]=> string(12) "iconv_strlen" [5]=> string(12) "iconv_substr" [6]=> string(12) "iconv_strpos" [7]=> string(13) "iconv_strrpos" [8]=> string(17) "iconv_mime_encode" [9]=> string(17) "iconv_mime_decode" [10]=> string(25) "iconv_mime_decode_headers" }