php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52611 compile problem with iconv
Submitted: 2010-08-15 12:38 UTC Modified: 2010-08-16 12:29 UTC
From: parsadev at yahoo dot com Assigned:
Status: Not a bug Package: ICONV related
PHP Version: 5.3.3 OS: Centos 5.5 x86_64
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: parsadev at yahoo dot com
New email:
PHP Version: OS:

 

 [2010-08-15 12:38 UTC] parsadev at yahoo dot com
Description:
------------
I'm trying to compile php 5.3.3 with libiconv-1.13.1 and centos 5.5 x86_64 (64-bits)
My configure command is:

./configure  --prefix=/usr/local/php5 --with-libdir=lib64 --enable-bcmath --with-bz2 --enable-calendar --with-curl --with-config-file-path=/usr/local/etc/php5/cgi --enable-dba --with-db4=/usr --enable-exif --with-libexpat-dir=/usr --with-freetype-dir=/usr --enable-ftp --with-gettext=/usr --with-gd --enable-gd-native-ttf --with-iconv --enable-inline-optimization --with-jpeg-dir=/usr --with-kerberos --with-libxml-dir=/usr --enable-magic-quotes --enable-mbregex --enable-mbstring --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-mysql-sock=/var/lib/mysql/mysql.sock --with-openssl-dir=/usr --with-pdo-mysql --with-pdo-pgsql --with-pear --with-pgsql --with-png-dir=/usr --with-readline=/usr --enable-soap --enable-sockets --enable-sqlite-utf8 --with-unixODBC=/usr --enable-wddx --with-xsl --enable-zip --with-zlib

configure is ok

but when I use 'make' I'm facing with error:

nd_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_ts_hash.lo Zend/zend_stream.lo Zend/zend_iterators.lo Zend/zend_interfaces.lo Zend/zend_exceptions.lo Zend/zend_strtod.lo Zend/zend_gc.lo Zend/zend_closures.lo Zend/zend_float.lo Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_default_classes.lo Zend/zend_execute.lo sapi/cgi/cgi_main.lo sapi/cgi/fastcgi.lo main/internal_functions.lo -lcrypt -lz -lexslt -lexpat -lexpat -lcrypt -lreadline -lncurses -lpq -lrt -lpq -lmysqlclient -lmcrypt -lltdl -lfreetype -lpng -lz -ljpeg -lssl -lcrypto -ldb-4.3 -lcurl -lbz2 -lz -lm -ldl -lnsl -lxml2 -lz -lm -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz -lxml2 -lz -lm -lmysqlclient -lz -lcrypt -lnsl -lm -lssl -lcrypto -lodbc -lmysqlclient -lz -lcrypt -lnsl -lm -lssl -lcrypto -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxslt -lxml2 -lz -lm -lcrypt  -o sapi/cgi/php-cgi
ext/gd/libgd/gdkanji.o: In function `do_convert':
/root/src/php-5.3.3/ext/gd/libgd/gdkanji.c:350: undefined reference to `libiconv_open'
/root/src/php-5.3.3/ext/gd/libgd/gdkanji.c:365: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/gd/libgd/gdkanji.c:381: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_strlen':
/root/src/php-5.3.3/ext/iconv/iconv.c:592: undefined reference to `libiconv_open'
/root/src/php-5.3.3/ext/iconv/iconv.c:615: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:649: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `php_iconv_string':
/root/src/php-5.3.3/ext/iconv/iconv.c:430: undefined reference to `libiconv_open'
/root/src/php-5.3.3/ext/iconv/iconv.c:442: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:456: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:467: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_strpos':
/root/src/php-5.3.3/ext/iconv/iconv.c:840: undefined reference to `libiconv_open'
/root/src/php-5.3.3/ext/iconv/iconv.c:868: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:982: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_appendl':
/root/src/php-5.3.3/ext/iconv/iconv.c:337: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:374: undefined reference to `libiconv'
ext/iconv/iconv.o: In function `_php_iconv_substr':
/root/src/php-5.3.3/ext/iconv/iconv.c:712: undefined reference to `libiconv_open'
/root/src/php-5.3.3/ext/iconv/iconv.c:736: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:791: undefined reference to `libiconv_close'
/root/src/php-5.3.3/ext/iconv/iconv.c:795: undefined reference to `libiconv_close'
/root/src/php-5.3.3/ext/iconv/iconv.c:744: undefined reference to `libiconv_open'
ext/iconv/iconv.o: In function `_php_iconv_mime_decode':
/root/src/php-5.3.3/ext/iconv/iconv.c:1342: undefined reference to `libiconv_open'
/root/src/php-5.3.3/ext/iconv/iconv.c:1453: undefined reference to `libiconv_close'
/root/src/php-5.3.3/ext/iconv/iconv.c:1456: undefined reference to `libiconv_open'
/root/src/php-5.3.3/ext/iconv/iconv.c:1811: undefined reference to `libiconv_close'
/root/src/php-5.3.3/ext/iconv/iconv.c:1814: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `php_iconv_stream_filter_dtor':
/root/src/php-5.3.3/ext/iconv/iconv.c:2440: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_mime_encode':
/root/src/php-5.3.3/ext/iconv/iconv.c:1032: undefined reference to `libiconv_open'
/root/src/php-5.3.3/ext/iconv/iconv.c:1046: undefined reference to `libiconv_open'
/root/src/php-5.3.3/ext/iconv/iconv.c:1304: undefined reference to `libiconv_close'
/root/src/php-5.3.3/ext/iconv/iconv.c:1307: undefined reference to `libiconv_close'
/root/src/php-5.3.3/ext/iconv/iconv.c:1165: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:1117: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:1149: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:1307: undefined reference to `libiconv_close'
/root/src/php-5.3.3/ext/iconv/iconv.c:1217: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:1248: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:1291: undefined reference to `libiconv'
ext/iconv/iconv.o: In function `php_iconv_stream_filter_append_bucket':
/root/src/php-5.3.3/ext/iconv/iconv.c:2590: undefined reference to `libiconv'
/root/src/php-5.3.3/ext/iconv/iconv.c:2590: undefined reference to `libiconv'
ext/iconv/iconv.o:/root/src/php-5.3.3/ext/iconv/iconv.c:2512: more undefined references to `libiconv' follow
ext/iconv/iconv.o: In function `php_iconv_stream_filter_ctor':
/root/src/php-5.3.3/ext/iconv/iconv.c:2466: undefined reference to `libiconv_open'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1

Please give a solution to this issue.

Regards,
Parsa


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-15 14:49 UTC] parsadev at yahoo dot com
excuse me. the correct configure command is:

./configure  --prefix=/usr/local/php5 --with-libdir=lib64 --enable-bcmath --with-bz2 --enable-calendar --with-curl --with-config-file-path=/usr/local/etc/php5/cgi --enable-dba --with-db4=/usr --enable-exif --with-libexpat-dir=/usr --with-freetype-dir=/usr --enable-ftp --with-gettext=/usr --with-gd --enable-gd-native-ttf --with-iconv-dir=/usr/local/lib --enable-inline-optimization --with-jpeg-dir=/usr --with-kerberos --with-libxml-dir=/usr --enable-magic-quotes --enable-mbregex --enable-mbstring --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-mysql-sock=/var/lib/mysql/mysql.sock --with-openssl-dir=/usr --with-pdo-mysql --with-pdo-pgsql --with-pear --with-pgsql --with-png-dir=/usr --with-readline=/usr --enable-soap --enable-sockets --enable-sqlite-utf8 --with-unixODBC=/usr --enable-wddx --with-xsl --enable-zip --with-zlib
 [2010-08-16 05:00 UTC] aharvey@php.net
-Status: Open +Status: Bogus
 [2010-08-16 05:00 UTC] aharvey@php.net
Building PHP with --with-iconv works fine on a stock CentOS 5.5 install. This looks like an issue with your libiconv installation (remembering that CentOS doesn't ship with libiconv, nor is it available in the standard repository), rather than PHP itself.
 [2010-08-16 07:33 UTC] parsadev at yahoo dot com
Yes, in 32bits centos there is no problem. but this problem occures in 64bits os.
I installed libiconv with this configure command (configure --prefix=/usr/local)
and tested PHP installation with minimum of config like below:

./configure  --prefix=/usr/local/php5 --with-config-file-path=/usr/local/etc/php5/cgi --with-iconv

and the same error is viewed.
Are you tested compile with below configs?

Centos 5.5 x86_64 (64bit)
PHP 5.3.3
libiconv 1.13.1
 [2010-08-16 08:09 UTC] aharvey@php.net
Use --with-iconv=/usr/local, then -- having two separate implementations of iconv() around is just asking for trouble, particularly if you don't tell configure explicitly which path to use.

And yes, I did test it.

At any rate, this is a support issue rather than a bug, so I'd suggest following this up with the support channels rather than here.
 [2010-08-16 12:29 UTC] parsadev at yahoo dot com
aharvey, Thanks for your guide. Finally I compiled it successfully. but some helps to this issue:

1. If you install 64-bit version of Centos and then remove all the i386-i686 packages(yum remove \*.i\?86), then you must add --with-libdir=lib64 to solve the first problem of compiling modules.
2. When you set lib64 for libdir, you will face to my problem that I reported here. to solve this problem you can install libiconv with (configure --prefix=/usr/local/iconv), then in the '/usr/local/inconv' link the folder 'lib' to 'lib64' near it (ln -s /usr/local/iconv/lib /usr/local/iconv/lib64). Then config your php. (for install iconv module for php use --with-iconv-dir=/usr/local/iconv).

Best Regards,
Parsa
 [2010-08-19 17:09 UTC] beremour at gmail dot com
Same issue under OpenBSD 4.7 AMD64

ext/iconv/.libs/iconv.o(.text+0x2c1): In function `_php_iconv_appendl':
/var/data/src/php-5.3.3/ext/iconv/iconv.c:337: undefined reference to `iconv'
ext/iconv/.libs/iconv.o(.text+0x3b7):/var/data/src/php-
5.3.3/ext/iconv/iconv.c:374: undefined reference to `iconv'
ext/iconv/.libs/iconv.o(.text+0x4d5): In function `php_iconv_string':
/var/data/src/php-5.3.3/ext/iconv/iconv.c:521: undefined reference to `iconv'
ext/iconv/.libs/iconv.o(.text+0x5b7):/var/data/src/php-
5.3.3/ext/iconv/iconv.c:501: undefined reference to `iconv'
ext/iconv/.libs/iconv.o(.text+0x6e3): In function `_php_iconv_strlen':
/var/data/src/php-5.3.3/ext/iconv/iconv.c:615: undefined reference to `iconv'
ext/iconv/.libs/iconv.o(.text+0x96e):/var/data/src/php-
5.3.3/ext/iconv/iconv.c:736: more undefined references to `iconv' follow
collect2: ld returned 1 exit status
*** Error code 1

Stop in /var/data/src/php-5.3.3 (line 255 of Makefile).
#
 [2010-10-16 10:10 UTC] abdelma999 at yahoo dot com
Same issue under Cygwin 1.7.7-1
./configure --with-iconv
make

ext/iconv/iconv.o: In function `_php_iconv_appendl':
/home/r/php-5.3.3/ext/iconv/iconv.c:337: undefined reference to `_iconv'
/home/r/php-5.3.3/ext/iconv/iconv.c:374: undefined reference to `_iconv'
ext/iconv/iconv.o: In function `_php_iconv_strlen':
/home/r/php-5.3.3/ext/iconv/iconv.c:615: undefined reference to `_iconv'
ext/iconv/iconv.o: In function `_php_iconv_substr':
/home/r/php-5.3.3/ext/iconv/iconv.c:736: undefined reference to `_iconv'
ext/iconv/iconv.o: In function `php_iconv_string':
/home/r/php-5.3.3/ext/iconv/iconv.c:501: undefined reference to `_iconv'
ext/iconv/iconv.o:/home/r/php-5.3.3/ext/iconv/iconv.c:521: more undefined references to `_iconv' follow
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi.exe] Error 1
 [2012-02-17 13:09 UTC] g dot rossolini at gmail dot com
Hi,

I had the same problem (a bundled iconv + another version I compiled myself) and I just had to give "configure" the path to the libiconv I wanted to use, like this:
./configure --disable-all --with-iconv=/usr/local/lib

Then I could compile PHP 5.3.10 with libiconv 1.14, libpng etc.
I have no idea why "configure" does not appear to look for this version, like it does for every other lib.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 01:01:30 2024 UTC