From owner-freebsd-questions@FreeBSD.ORG Wed Sep 7 09:23:04 2005 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 26C3C16A41F for ; Wed, 7 Sep 2005 09:23:04 +0000 (GMT) (envelope-from toomas.aas@raad.tartu.ee) Received: from lv.raad.tartu.ee (lv.raad.tartu.ee [194.126.106.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8093B43D45 for ; Wed, 7 Sep 2005 09:23:02 +0000 (GMT) (envelope-from toomas.aas@raad.tartu.ee) Received: Message by Barricade lv.raad.tartu.ee with ESMTP id j879N0w1010241; Wed, 7 Sep 2005 12:23:00 +0300 Received: from INFO/SpoolDir by raad.tartu.ee (Mercury 1.48); 7 Sep 05 12:23:01 +0300 Received: from SpoolDir by INFO (Mercury 1.48); 7 Sep 05 12:22:48 +0300 Received: from [192.168.1.2] (192.168.1.2) by raad.tartu.ee (Mercury 1.48) with ESMTP; 7 Sep 05 12:22:47 +0300 Message-ID: <431EB169.7010602@raad.tartu.ee> Date: Wed, 07 Sep 2005 12:22:49 +0300 From: Toomas Aas User-Agent: Mozilla Thunderbird 1.0RC1 (Windows/20041201) X-Accept-Language: en-us, en MIME-Version: 1.0 To: php-general@lists.php.net, questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Cc: Subject: iconv() in PHP returns 'Unknown error 0' X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2005 09:23:04 -0000 Hello! I am managing a FreeBSD 4.11 server which is currently running PHP=20 4.3.11. The server was originally installed in 2003 with an older=20 version of PHP and libiconv 1.8. All software has been installed from=20 FreeBSD ports. Over the time PHP has been upgraded several times, but=20 libiconv has remained untouched: mail# pkg_info | grep iconv libiconv-1.8_2 A character set conversion library php4-iconv-4.3.11 The iconv shared extension for php There was a time when PHP's iconv() function definitely worked on this=20 server, but now it seems to have a problem. I copied and pasted this=20 simple test script from www.php.net: ----------------------------------------------------- ----------------------------------------------------- When I load this script via the browser, PHP outputs nothing. I have=20 error logging set to file only, and in the log file there is this error: [07-Sep-2005 12:10:07] PHP Notice: iconv(): Unknown error (0) in=20 /storage/www/iconvtest.php on line 2 This is the only error I see in PHP's error log or any other logfile=20 with similar timestamp. The iconv extension is loaded and can be seen in output of phpinfo(). I read that sometimes on FreeBSD you need to use libiconv() instead of=20 iconv(), but this is not the case here - when I replace iconv() with=20 libiconv() I get "PHP Fatal error: Call to undefined function:=20 libiconv()". I can successfully run iconv from command line: $ echo This is a test. > iconvtest $ iconv -f "ISO-8859-1" -t "UTF-8" iconvtest This is a test. Is it possible that my problem is caused by anything *else* than iconv=20 library being out of date compared to PHP's iconv extension? If I need=20 to update libiconv, I also need to update lot of things that depend on=20 it, and this takes some time. If there is some quicker way to get PHP's=20 iconv extension functional, I'd prefer to use that for now. --=20 Toomas Aas -------------------------------------------------------- |arvutiv=F5rgu peaspetsialist | head specialist on computer networks| |Tartu Linnakantselei | Tartu City Office | ----------------------------------------------------- +372 736 1274