Call to iconv() gives "undefined function" error, php -i says iconv functional
| Bug #26194 | Call to iconv() gives "undefined function" error, php -i says iconv functional | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2003-11-10 21:24 UTC | Modified: | 2003-11-22 08:56 UTC |
|
||||||
| From: | bjorn dot wiberg at home dot se | Assigned: | ||||||||
| Status: | Closed | Package: | ICONV related | |||||||
| PHP Version: | 5.0.0b2 (beta2) | OS: | Windows XP Professional SP-1 | |||||||
| Private report: | No | CVE-ID: | None | |||||||
[2003-11-10 21:24 UTC] bjorn dot wiberg at home dot se
Description:
------------
I'm using the binary distribution of PHP 5.0.0b2.
Calling iconv() fails with an "undefined function" error, although php -i and phpinfo() reports the iconv extension to be functional. This problem did not occur with 5.0.0b1.
Path to php.ini is E:\Utils\Apache Group\Apache2\custom\conf\php.ini (set in httpd.conf through the PHPINIDir directive -- I'm running it with Apache 2.0.48, everything works fine except for this).
Extension dir is E:\Utils\PHP\extensions (set in php.ini).
The php_iconv.dll extension is loaded in php.ini. I'm also using the php_exif.dll, php_gd2.dll, php_mime_magic.dll (and in 5.0.0b2, php_mysql.dll) extensions.
The php4ts.dll, iconv.dll and libmySQL.dll files have been copied to the E:\Utils\PHP\sapi\ directory which Apache loads the PHP module (php4apache2.dll) from.
E:\Utils\PHP and E:\Utils\PHP\dlls are in the PATH environment variable.
I also tried the php5-win32-200311102330.zip snapshot, but got the same error.
Reproduce code:
---------------
[test.php]
<?php
echo iconv("ISO-8859-1","UTF-8","This is a test.");
?>
Expected result:
----------------
The text "This is a test.". The script works fine with PHP 5.0.0b1:
E:\Utils\PHP>php.exe -c "\Utils\Apache Group\Apache2\custom\conf" "\Utils\Apache Group\Apache2\custom\php-bin\vhosts\myhost.dyndns.org\test.php"
Content-type: text/html
X-Powered-By: PHP/5.0.0b1
This is a test.
E:\Utils\PHP>php.exe -c "\Utils\Apache Group\Apache2\custom\conf" -i | grep iconv
<h2><a name="module_iconv">iconv</a></h2>
<tr><td class="e">iconv support </td><td class="v">enabled </td></tr>
<tr><td class="e">iconv implementation </td><td class="v">libiconv </td></tr>
<tr><td class="e">iconv library version </td><td class="v">1.8 </td></tr>
<tr><td class="e">iconv.input_encoding</td><td class="v">ISO-8859-1</td><td clas
s="v">ISO-8859-1</td></tr>
<tr><td class="e">iconv.internal_encoding</td><td class="v">ISO-8859-1</td><td c
lass="v">ISO-8859-1</td></tr>
<tr><td class="e">iconv.output_encoding</td><td class="v">ISO-8859-1</td><td cla
ss="v">ISO-8859-1</td></tr>
E:\Utils\PHP>php.exe -c "\Utils\Apache Group\Apache2\custom\conf" -v
PHP 5.0.0b1 (cgi-fcgi) (built: Jun 28 2003 00:31:05)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v2.0.0-dev, Copyright (c) 1998-2003 Zend Technologies
Actual result:
--------------
An "undefined function" error:
E:\Utils\PHP>php.exe -c "\Utils\Apache Group\Apache2\custom\conf" "\Utils\Apache Group\Apache2\custom\php-bin\vhosts\myhost.dyndns.org\test.php"
PHP Fatal error: Call to undefined function iconv() in E:\Utils\Apache Group\Apache2\custom\php-bin\vhosts\myhost.dyndns.org\test.php on line 3
Content-type: text/html
X-Powered-By: PHP/5.0.0b2
E:\Utils\PHP>php -c "\Utils\Apache Group\Apache2\custom\conf\php.ini" -i | grep
iconv
<h2><a name="module_iconv">iconv</a></h2>
<tr><td class="e">iconv support </td><td class="v">enabled </td></tr>
<tr><td class="e">iconv implementation </td><td class="v">libiconv </td></tr>
<tr><td class="e">iconv library version </td><td class="v">1.8 </td></tr>
<tr><td class="e">iconv.input_encoding</td><td class="v">ISO-8859-1</td><td clas
s="v">ISO-8859-1</td></tr>
<tr><td class="e">iconv.internal_encoding</td><td class="v">ISO-8859-1</td><td c
lass="v">ISO-8859-1</td></tr>
<tr><td class="e">iconv.output_encoding</td><td class="v">ISO-8859-1</td><td cla
ss="v">ISO-8859-1</td></tr>
E:\Utils\PHP>php -v
PHP 5.0.0b2 (cgi-fcgi) (built: Oct 30 2003 12:37:18)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v2.0.0-dev, Copyright (c) 1998-2003 Zend Technologies
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2003-11-21 10:11 UTC] sfox@php.net
[2003-11-21 14:50 UTC] sfox@php.net
[2003-11-21 23:14 UTC] moriyoshi@php.net
[2003-11-22 08:56 UTC] sfox@php.net