ID: 49267 Comment by: lperry65 at gmail dot com Reported By: s dot rost at ewerk dot com Status: No Feedback Bug Type: Compile Failure Operating System: Mac OSX 10.6 Snow Leopard PHP Version: 5.3, 6 (2009-08-18) Assigned To: scottmac New Comment:
I just tried to install 5.3.1 on os x 10.6.2 and had the following error: Undefined symbols: "_libiconv", referenced from: etc etc. Is this issue going to fixed anytime soon ? Previous Comments: ------------------------------------------------------------------------ [2010-02-11 10:14:06] sj at sjaensch dot org The problem seems to be related to MacPorts, which often installs its own version of libiconv as dependency for several other ports. In my case, I'm using the MacPorts libpng, jpeg and freetype ports to compile PHP. Even though I specified --with-iconv-dir=/usr, it seems that the version in /opt/local gets picked up at the linking stage. The reason is that the linker command includes -L/opt/local/lib and -Wl,- rpath,/opt/local/lib. ------------------------------------------------------------------------ [2010-01-28 23:24:00] yux87 at hotmail dot com Okay, here's the result how I made it work against my environment and php version after a few times of failure in compiling: ------ Steps ------ 1. The only thing I tried to make it work was to hack the iconv.c as the patch above. ie. manually remove the #ifdef HAVE_LIBICONV, etc. lines. 2. Do a re-configure, re-make. ----- Result ----- ./configure --with-iconv-dir=/usr [Pass] ./make [Pass] ./make test [Okay, didn't notice any fail with iconv, not sure it's been tested though] ------ Configuration ------ Snow Leopard, with XCode. I did a fresh install rather than upgrade from the old 10.5 version, so I guess it could be the reason I didn't suffer the multiple iconv lib problem as some descriptions above. PHP version: 5.3.1 - 19 Nov 2009 release from the download page So I think the problem here is just some need to change the iconv.c code a bit. Hope this works for you, too. I also tried compiling with my macport iconv library(coz this'd be the actual one I'm going to use), there's no problem working with it too. ------------------------------------------------------------------------ [2010-01-03 11:48:35] iongion at yahoo dot com My system is a SNOW LEOPARD 10.6.2 I think we have a final solution. All these problems are generated because the Makefile is confused by the existence of multiple iconv library installations, but not only this. Fixing iconv (please note that these are pretty subjective, but they are a good start) Needed elements: 1) gettext - http://ftp.gnu.org/pub/gnu/gettext/gettext-0.17.tar.gz 2) iconv - http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz Unpack both libraries, before running configure, prepare your environment as follows: (i assume you have latest xcode) export MACOSX_DEPLOYMENT_TARGET=10.6; export CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"; export CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"; export CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch i386 -arch x86_64 -bind_at_load" and then run configure in gettext, leave prefix as it is, make & make install; NOW, building iconv will replace existing iconv from apple(it shouldn't break anything) ./configure --prefix=/usr --enable-shared --enable-static then: make sudo make install This did it, what i managed to achieve: 1) Replace php 5.3.0 that comes with Snow Leopard, with php 5.3.1 2) Replace php 5.3.0 that comes with Snow Leopard, with php 5.2.12 Managed to install pecl extensions, apc, xdebug, uploadprogress, ming I am now on php 5.2.12 as i do drupal development and there are some module issues with php 5.3, but you could easily replace Snow Leo's php 5.3.0 with 5.3.1 and have your own pecl extensions/features enables Bellow are build scripts that i use to compile php 5.3.1 and php 5.2.12 1) 5.2.12 -> http://dpaste.com/hold/140511/ 2) 5.3.1 -> http://dpaste.com/hold/140512/ Good luck and hopefully php will get some better less confused build scripts. This the link that made me think and search more http://blog.yimingliu.com/2009/02/24/missing-library-symbols-while-compiling-php-528/ I have a little more than 0 knowledge of unix build tools, make, conf, gcc ... i am a php developer, excuse the non-initiated terms. ------------------------------------------------------------------------ [2010-01-02 13:41:56] iongion at yahoo dot com This is the output of make at its last step before throwing the hell http://dpaste.com/hold/140147/ ------------------------------------------------------------------------ [2010-01-02 13:36:06] iongion at yahoo dot com It does not work for me, same Snow Leopard I've added all possible combination of fixes Using the latest php snapshot php5.3-201001012330 http://www.opensource.apple.com/source/apache_mod_php/apache_mod_php- 53/patches/iconv.patch Here is the build script ./configure \ '--with-iconv-dir=/usr' \ '--prefix=/usr' \ '--mandir=/usr/share/man' \ '--infodir=/usr/share/info' \ '--sysconfdir=/private/etc' \ '--with-apxs2=/usr/sbin/apxs' \ '--enable-cli' \ '--with-config-file-path=/etc' \ '--with-libxml-dir=/usr' \ '--with-openssl=/usr' \ '--with-kerberos=/usr' \ '--with-zlib=/usr' \ '--enable-bcmath' \ '--with-bz2=/usr' \ '--enable-calendar' \ '--with-curl=/usr' \ '--enable-exif' \ '--enable-ftp' \ '--with-gd' \ '--with-jpeg-dir=/usr/local' \ '--with-png-dir=/usr/local' \ '--enable-gd-native-ttf' \ '--with-ldap=/usr' \ '--with-ldap-sasl=/usr' \ '--enable-mbstring' \ '--enable-mbregex' \ '--with-mysql=mysqlnd' \ '--with-mysqli=mysqlnd' \ '--with-pdo-mysql=mysqlnd' \ '--with-iodbc=/usr' \ '--enable-shmop' \ '--with-snmp=/usr' \ '--enable-soap' \ '--enable-sockets' \ '--enable-sysvmsg' \ '--enable-sysvsem' \ '--enable-sysvshm' \ '--with-xmlrpc' \ '--with-xsl=/usr' \ '--with-pcre-regex' \ '--with-mcrypt' \ '--with-mhash' \ '--enable-zip' \ '--with-curl' \ '--with-pear' With iconv dir set to /usr/local, still not working, arghhh ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/49267 -- Edit this bug report at http://bugs.php.net/?id=49267&edit=1