From: wellswang at auo dot com
Operating system: FreeBSD 5.3
PHP version: 5.0.3
PHP Bug Type: ICONV related
Bug description: enabled iconv extension but got "undefined function iconv()"
error
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 bug report at http://bugs.php.net/?id=32244&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32244&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32244&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32244&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32244&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32244&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32244&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32244&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32244&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32244&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32244&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32244&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32244&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32244&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32244&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32244&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32244&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32244&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32244&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32244&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32244&r=mysqlcfg