|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25509 iconv() function disappears and reappears at random times
Submitted: 2003-09-12 04:54 UTC Modified: 2003-09-17 18:52 UTC
From: mans at agoodid dot com Assigned:
Status: Not a bug Package: ICONV related
PHP Version: 4.3.2 OS: Linux i686
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
7 + 4 = ?
Subscribe to this entry?

 [2003-09-12 04:54 UTC] mans at agoodid dot com
For some reason, PHP reports:

Call to undefined function: iconv()

from time to time. A little later, the function will work without a hitch, without any changes being made to the PHP configuration. 

Configure command is:

'./configure' '--with-kerberos' '--with-openssl' '--prefix=/usr/local' '--with-mysql=/usr' '--with-gd' '--with-imap' '--with-imap-ssl' '--with-xml' '--with-zlib' '--enable-bcmath' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-track-vars' '--enable-versioning' '--with-ldap' '--with-mcrypt' '--with-mhash' '--with-pdflib=/usr' '--enable-shared-pdflib' '--with-swf' '--with-ttf' '--with-t1lib' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-memory-limit' '--enable-dbase' '--enable-ftp' '--with-curl'

Reproduce code:
Code which generates the error, but later works fine: 

function mime_decode($s) {
  $elements = imap_mime_header_decode($s);
  for($i = 0;$i < count($elements);$i++) {
    $charset = $elements[$i]->charset;
    $text =$elements[$i]->text;
    if(!strcasecmp($charset, "utf-8") ||
       !strcasecmp($charset, "utf-7"))
      $text = iconv($charset, "iso-8859-1", $text);
    $decoded = $decoded . $text;
  return $decoded;

Note: The indata does not change either - same code with same data works fine from time to time - at other times not. Can't see any pattern to when it works and when it doesn't.

Expected result:
$text converted into iso-8859-1 format from UTF-8.

Actual result:
Call to undefined function: iconv()


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-17 18:52 UTC]
Try enabling the extension, maybe it will work better then? :)
(hint: --with-iconv)

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 05:03:34 2021 UTC