Discussion:
iconv error in php
gerard henry
2011-05-04 12:05:48 UTC
Permalink
hello all,
my web server is b134, apache22, php 5.2:
# pkg search -l /usr/php/5.2/modules/iconv.so
INDEX ACTION VALUE PACKAGE
path file usr/php/5.2/modules/iconv.so
pkg:/web/php-***@5.2.12-0.134.0.2

i'm trying the first example given here:
http://www.php.net/manual/en/function.iconv.php

and it fails with the message:
PHP Notice: iconv() [<a href='function.iconv'>function.iconv</a>]: Unknown
error (22) in ...

Does it mean that i forgot to configure something, or is it a problem with
the current php lib?

thanks in advance fo help,

gerard
Randy Jones
2011-05-04 13:56:36 UTC
Permalink
Post by gerard henry
hello all,
# pkg search -l /usr/php/5.2/modules/iconv.so
INDEX ACTION VALUE PACKAGE
http://www.php.net/manual/en/function.iconv.php
PHP Notice: iconv() [<a href='function.iconv'>function.iconv</a>]: Unknown error (22) in ...
Does it mean that i forgot to configure something, or is it a problem with the current php lib?
thanks in advance fo help,
gerard
Maybe you are seeing this bug:
http://bugs.php.net/bug.php?id=53005

Don't know whether this affects opensolaris but is certainly affects Solaris 10.
The LD_PRELOAD_64 (or LD_PRELOAD_32) work around mentioned will work.
--
------------------------------------------------------------------------
Randy Jones
Systems Administrator
Great Plains Mfg., Inc.
1525 E North St
PO Box 5060
Salina, KS USA 67401
email: randy-***@public.gmane.org
Phone: 785-823-3276
Fax: 785-667-2695
------------------------------------------------------------------------
solarg
2011-05-04 14:52:25 UTC
Permalink
ok, use csw lib iconv that contains: /opt/csw/lib/preloadable_libiconv.so

but, when i restart apache, pldd gave me:
webservd 22436 22422 0 16:40:57 ? 0:00
/usr/apache2/2.2/bin/httpd -k start
***@server# pldd 22436|grep icon
/opt/csw/lib/preloadable_libiconv.so
/usr/php/5.2/modules/iconv.so

but unfortunately, it doesn't work yet:
PHP Notice: iconv() [<a href='function.iconv'>function.iconv</a>]:
Unknown error (88) in ...

the error code has changed


2011/5/4 gerard henry <solarg87-***@public.gmane.org <mailto:solarg87-***@public.gmane.org>>

great! but where is preloadable_libiconv.so in b134?
# pkg search preloadable_libiconv.so
INDEX ACTION VALUE PACKAGE
basename file usr/gnu/lib/amd64/preloadable_libiconv.so
pkg:/SUNWgnu-***@0.5.11-0.75
basename file usr/gnu/lib/preloadable_libiconv.so
pkg:/SUNWgnu-***@0.5.11-0.75
basename file usr/gnu/lib/amd64/preloadable_libiconv.so
pkg:/SUNWgnu-***@0.5.11-0.79
basename file usr/gnu/lib/preloadable_libiconv.so
pkg:/SUNWgnu-***@0.5.11-0.79
basename file usr/gnu/lib/amd64/preloadable_libiconv.so
pkg:/SUNWgnu-***@0.5.11-0.75
basename file usr/gnu/lib/preloadable_libiconv.so
pkg:/SUNWgnu-***@0.5.11-0.75

SUNWgnu-libiconv disappeared in b134 or am i not looking at the
right file?



2011/5/4 Randy Jones <randy-***@public.gmane.org
<mailto:randy-***@public.gmane.org>>

On 05/04/11 07:05, gerard henry wrote:

hello all,
my web server is b134, apache22, php 5.2:
# pkg search -l /usr/php/5.2/modules/iconv.so
INDEX ACTION VALUE PACKAGE
path file usr/php/5.2/modules/iconv.so
pkg:/web/php-***@5.2.12-0.134.0.2

i'm trying the first example given here:
http://www.php.net/manual/en/function.iconv.php

and it fails with the message:
PHP Notice: iconv() [<a
href='function.iconv'>function.iconv</a>]: Unknown error
(22) in ...

Does it mean that i forgot to configure something, or is it
a problem with the current php lib?

thanks in advance fo help,

gerard


Maybe you are seeing this bug:
http://bugs.php.net/bug.php?id=53005

Don't know whether this affects opensolaris but is certainly
affects Solaris 10.
The LD_PRELOAD_64 (or LD_PRELOAD_32) work around mentioned will
work.


--
------------------------------------------------------------------------
Randy Jones
Systems Administrator
Great Plains Mfg., Inc.
1525 E North St
PO Box 5060
Salina, KS USA 67401
email: randy-***@public.gmane.org <mailto:randy-***@public.gmane.org>
Phone: 785-823-3276
Fax: 785-667-2695
------------------------------------------------------------------------
gerard henry
2011-05-05 06:03:14 UTC
Permalink
yes i have it

# pkg list | grep iconv
system/library/iconv/utf-8 (opensolaris.org) 0.5.11-0.134.0.2 installed
-----
Post by gerard henry
Post by gerard henry
hello all,
# pkg search -l /usr/php/5.2/modules/iconv.so
INDEX ACTION VALUE PACKAGE
path file usr/php/5.2/modules/iconv.so
http://www.php.net/manual/en/function.iconv.php
Unknown error (22) in ...
Post by gerard henry
Does it mean that i forgot to configure something, or is it a problem
with the current php lib?
Can you confirm that you have 'iconv' packge installed on your system.
pkg list | grep iconv
If this returns empty, then I believe, you will need to install this by
doing some thing like
pfexec pkg install system/library/iconv/
- Sriram
Post by gerard henry
thanks in advance fo help,
gerard
_______________________________________________
webstack-discuss mailing list
http://mail.opensolaris.org/mailman/listinfo/webstack-discuss
Richard PALO
2011-05-06 05:22:08 UTC
Permalink
perhaps there are additional packages to install...
Here the following are listed:
~$ pkg list -a *iconv*
NAME (PUBLISHER) VERSION STATE UFOXI
SFElibiconv (localpkgs) 1.13.1-0.148 installé -----
SFElibiconv/src (localpkgs) 1.13.1-0.148 connu -----
SUNWgnu-libiconv (opensolaris.org) 0.5.11-0.130 connu --o--
system/library/iconv/extra 0.5.11-0.148 connu -----
system/library/iconv/unicode 0.5.11-0.148 installé -----
system/library/iconv/utf-8 0.5.11-0.148 installé -----
system/library/iconv/utf-8/manual 0.5.11-0.148 installé -----
system/library/iconv/xsh4/eastern-european 0.5.11-0.140 connu --o--
system/library/iconv/xsh4/latin 0.5.11-0.148 installé -----


cdlt
--
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing l
Sriram Natarajan
2011-05-05 03:57:43 UTC
Permalink
Post by gerard henry
hello all,
# pkg search -l /usr/php/5.2/modules/iconv.so
INDEX ACTION VALUE PACKAGE
http://www.php.net/manual/en/function.iconv.php
PHP Notice: iconv() [<a href='function.iconv'>function.iconv</a>]: Unknown error (22) in ...
Does it mean that i forgot to configure something, or is it a problem with the current php lib?
Can you confirm that you have 'iconv' packge installed on your system.
pkg list | grep iconv

If this returns empty, then I believe, you will need to install this by doing some thing like
pfexec pkg install system/library/iconv/


- Sriram
Post by gerard henry
thanks in advance fo help,
gerard
_______________________________________________
webstack-discuss mailing list
http://mail.opensolaris.org/mailman/listinfo/webstack-discuss
Jan Hnatek
2011-05-06 12:55:43 UTC
Permalink
Hi Gerard,

Solaris iconv in build 134b (and later) does not support the
//TRANSLIT and //IGNORE flags, therefore you're getting the
error. If you need these particular flags, you can probably
compile GNU libiconv from source, since that is not available
as a repository package. The compilation as such is easy, but
I'm not sure how much effort it takes to make php work with
that instead of the default iconv.

Regards,
hnhn
Post by gerard henry
hello all,
# pkg search -l /usr/php/5.2/modules/iconv.so
INDEX ACTION VALUE PACKAGE
path file usr/php/5.2/modules/iconv.so
http://www.php.net/manual/en/function.iconv.php
Unknown error (22) in ...
Does it mean that i forgot to configure something, or is it a problem
with the current php lib?
thanks in advance fo help,
gerard
_______________________________________________
opensolaris-discuss mailing list
--
Jan Hnatek
jan.hnatek-QHcLZuEGTsvQT0dZR+***@public.gmane.org
Randy Jones
2011-05-06 13:29:44 UTC
Permalink
Post by Jan Hnatek
Hi Gerard,
Solaris iconv in build 134b (and later) does not support the
//TRANSLIT and //IGNORE flags, therefore you're getting the
error. If you need these particular flags, you can probably
compile GNU libiconv from source, since that is not available
as a repository package. The compilation as such is easy, but
I'm not sure how much effort it takes to make php work with
that instead of the default iconv.
My notes to myself for building libiconv (both 32 and 64bit):
=================================================================================
Downloading:
1. download libiconv from http://www.gnu.org/software/libiconv/#downloading

Compiling (as user):
1. set the following environment variables and paths
setenv CC cc
setenv CXX CC
setenv CFLAGS "-m64" (only for 64 bit build)
set path=(/opt/SUNWspro/bin $path)
unsetenv LD_RUN_PATH
unsetenv LD_LIBRARY_PATH
unsetenv LIBS
unsetenv LDFLAGS

2. configure it
sparcv9/sparc
./configure --libdir=/usr/local/lib/sparcv9 --bindir=/usr/local/bin/sparcv9
./configure --bindir=/usr/local/bin/sparcv7

/x64/i86
./configure --libdir=/usr/local/lib/amd64 --bindir=/usr/local/bin/amd64
./configure --bindir=/usr/local/bin/i86

3. make
=================================================================================


My notes to myself for building php 5.2.17 (64bit):
=================================================================================
1. set the following environment variables
setenv LD_RUN_PATH /usr/lib/64:/usr/sfw/lib/64:/usr/local/lib/64
setenv LD_LIBRARY_PATH /usr/lib/64:/usr/sfw/lib/64:/usr/local/lib/64
setenv LDFLAGS "-L/usr/lib/64 -L/usr/sfw/lib/64 -L/usr/local/lib/64
-R/usr/lib/64 -R/usr/sfw/lib/64 -R/usr/local/lib/64"
setenv LIBS "-liconv"
setenv CC cc
setenv CXX cc
setenv CFLAGS "-m64"

2. configure the mess. Note the --with-openssl=/usr/local/apache2 to force use
of the ssl compiled
for apache
cd /files/source/apache/apache2.2/php-5.2.17_sol10-sparcv9
cd /files/source/apache/apache2.2/php-5.2.17_sol10-x64
configure --with-mysql=/opt/mysql/mysql --with-apxs2=/usr/local/apache2/bin/apxs \
--enable-inline-optimization --enable-ftp --with-zlib-dir --enable-soap
--with-openssl=/usr/local/apache2 \
--enable-sockets --enable-mbstring --with-gettext --with-pdo-mysql
--with-pdo-odbc=ibm-db2,/opt/IBM/db2/V9.5 \
--enable-calendar

3. edit (with vim) the Makefile and change all
-L/usr/local/lib to -L/usr/local/lib/64
and all
-R/usr/local/lib to -R/usr/local/lib/64

This is needed so the 64bit libiconv under /usr/local/lib/64 is used
instead of the 32bit under /usr/local/lib

4. make
=================================================================================
Post by Jan Hnatek
Regards,
hnhn
Post by gerard henry
hello all,
# pkg search -l /usr/php/5.2/modules/iconv.so
INDEX ACTION VALUE PACKAGE
path file usr/php/5.2/modules/iconv.so
http://www.php.net/manual/en/function.iconv.php
Unknown error (22) in ...
Does it mean that i forgot to configure something, or is it a problem
with the current php lib?
thanks in advance fo help,
gerard
_______________________________________________
opensolaris-discuss mailing list
--
------------------------------------------------------------------------
Randy Jones
Systems Administrator
Great Plains Mfg., Inc.
1525 E North St
PO Box 5060
Salina, KS USA 67401
email: randy-***@public.gmane.org
Phone: 785-823-3276
Fax: 785-667-2695
------------------------------------------------------------------------
Loading...