Leopard iconv and php5

started at 13 Nov 2007 by Sjaq
  • Sjaq
    13 Nov 2007

    I'm trying to compile my own version of php with a lot of options, but I can't get iconv to work. I read some reports on the internet about this problem but can't find a fix.

    my configurate command:

    ./configure --prefix=/usr/local/php5 \
    --mandir=/usr/share/man \
    --infodir=/usr/share/info \
    --sysconfdir=/etc \
    --with-zlib \
    --with-zlib-dir=/usr \
    --with-openssl \
    --enable-exif \
    --enable-ftp \
    --enable-mbstring \
    --enable-mbregex \
    --enable-sockets \
    --with-mysql=/usr/local/mysql \
    --with-mysqli=/usr/local/mysql/bin/mysql_config \
    --with-apxs2=/usr/local/apache/bin/apxs \
    --enable-zip \
    --with-xsl=/usr \
    --with-readline=/usr/local \
    --with-mcrypt \
    --with-mhash \
    --with-openssl-dir=/usr/local \
    --with-imagick=/usr/local \
    --with-imap=/usr/local/src/imap-2006k \
    --enable-xdebug \
    --enable-zip \
    --enable-memcache \
    --enable-debug \
    --with-fileinfo \
    --enable-apc \
    --with-gd=/usr/local \
    --with-ttf=/usr/local \
    --with-freetype-dir=/usr/local \
    --enable-gd-native-ttf \
    --with-xpm-dir=/usr/local \
    --with-png-dir=/usr/local \
    --with-jpeg-dir=/usr/local \
    --with-libxml-dir=/usr \
    --with-ldap=/usr \
    --with-kerberos=/usr \
    --enable-trans-sid \
    --enable-dbx \
    --with-iodbc=/usr \
    --with-curl=/usr \
    --with-config-file-path=/usr/local/php5/conf \
    --sysconfdir=/usr/local/php5/conf \
    --with-imap-ssl=/usr/local \
    --enable-force-cgi-redirect \
    --enable-fastcgi \
    --with-iconv \
    --with-ncurses=/sw

    I've tested a few options

    --with-iconv=/usr
    --with-iconv=/opt/local #macports
    --with-iconv

    But I get this error every time when I try to "make":

    Undefined symbols:
      \\"_iconv_close\\", referenced from:
          _php_iconv_string in iconv.o
          __php_iconv_strlen in iconv.o
          __php_iconv_strpos in iconv.o
          __php_iconv_mime_decode in iconv.o
          __php_iconv_mime_decode in iconv.o
          __php_iconv_mime_decode in iconv.o
          _zif_iconv_substr in iconv.o
          _zif_iconv_substr in iconv.o
          _php_iconv_stream_filter_dtor in iconv.o
          _zif_iconv_mime_encode in iconv.o
          _zif_iconv_mime_encode in iconv.o
      \\"_iconv_open\\", referenced from:
          _php_iconv_string in iconv.o
          __php_iconv_strlen in iconv.o
          __php_iconv_strpos in iconv.o
          __php_iconv_mime_decode in iconv.o
          __php_iconv_mime_decode in iconv.o
          _zif_iconv_substr in iconv.o
          _zif_iconv_substr in iconv.o
          _zif_iconv_mime_encode in iconv.o
          _zif_iconv_mime_encode in iconv.o
          _php_iconv_stream_filter_factory_create in iconv.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make: *** [sapi/cli/php] Error 1

    And when I use --without-iconv everything installs fine..
    I hope somebody knows how to fix this

  • Richard
    13 Nov 2007

    Did you install the http://www.gnu.org/software/libiconv/ iconv library ?

  • Sjaq
    13 Nov 2007

    Yes, tried it in two ways. Manually compiling and macports..

  • Richard
    13 Nov 2007

    If you look at the config.log file, is the iconv stuff properly recognized ?

    It looks like the library isn't found during linking.

    Do you know where the lib is installed? Did you specify the full path to the lib, like for instance '--with-iconv=/usr/local'

  • Sjaq
    14 Nov 2007

    There seems to be some error in my config.log file concerning iconv:

    configure:62339: checking for iconv support
    configure:62378: result: yes
    configure:62715: checking for libiconv in -liconv
    configure:62750: gcc -o conftest -g -O2  -no-cpp-precomp -Wl,-rpath,/usr/local/lib -L/usr/local/lib  -Wl,-rpath,/usr/local/ssl/lib -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib conftest.c -liconv  -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lssl -lcrypto -lcurl -lz -lssl -lcrypto -lm  -lxml2 -lz -licucore -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lssl -lcrypto -lz -lxml2 -lz -licucore -lm >&5
    configure:62756: $? = 0
    configure:62775: result: yes
    configure:63155: checking if iconv is glibc's
    configure:63178: gcc -o conftest -I/usr/local/include -g -O2  -no-cpp-precomp -L/usr/local/lib  -Wl,-rpath,/usr/local/ssl/lib -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c -liconv -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lssl -lcrypto -lcurl -lz -lssl -lcrypto -lm  -lxml2 -lz -licucore -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lssl -lcrypto -lz -lxml2 -lz -licucore -lm >&5
    conftest.c:256:30: error: gnu/libc-version.h: No such file or directory
    configure:63184: $? = 1
    configure: failed program was:
    | /* confdefs.h.  */
    | #define PACKAGE_NAME \"\"

    cut some #define stuff here

    | #define SIZEOF_LONG_LONG 8
    | #define HAVE_LIBICONV 1
    | #define HAVE_ICONV 1
    | /* end confdefs.h.  */
    | #include <gnu/libc-version.h>
    | int
    | main ()
    | {
    | gnu_get_libc_version();
    |   ;
    |   return 0;
    | }
    configure:63200: result: no
    configure:63209: checking if using GNU libiconv
    configure:63240: gcc -o conftest -I/usr/local/include -g -O2  -no-cpp-precomp -liconv -L/usr/local/lib  -Wl,-rpath,/usr/local/ssl/lib -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c -liconv -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lssl -lcrypto -lcurl -lz -lssl -lcrypto -lm  -lxml2 -lz -licucore -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lssl -lcrypto -lz -lxml2 -lz -licucore -lm >&5
    conftest.c: In function 'main':
    conftest.c:259: warning: incompatible implicit declaration of built-in function 'printf'
    configure:63243: $? = 0
    configure:63249: ./conftest
    configure:63252: $? = 0
    configure:63255: result: yes
    configure:63487: checking if iconv supports errno
    configure:63534: gcc -o conftest -I/usr/local/include -g -O2  -no-cpp-precomp -liconv -L/usr/local/lib  -Wl,-rpath,/usr/local/ssl/lib -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib conftest.c -liconv -liconv -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lssl -lcrypto -lcurl -lz -lssl -lcrypto -lm  -lxml2 -lz -licucore -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lssl -lcrypto -lz -lxml2 -lz -licucore -lm >&5
    configure:63537: $? = 0
    configure:63543: ./conftest
    configure:63546: $? = 0
    configure:63549: result: yes

    And yes I used a full path to my lib which is in /usr/local.. (tried: --with-iconv=/usr/local)

  • Richard
    14 Nov 2007

    I'm a bit a loss here as I can't try this myself, haven't got the time for to try this now. I' still working on the Leopard compatibility list for the mailserver.

    A last shot would be: try to compile iconv lib and php using the extra line before the configure statement as with all the tiger configures: CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk" \

  • Sjaq
    16 Nov 2007

    I tried that, didn't work either.

    I have built php without iconv now, oh btw there are problems with pear too. So to get it to work on my system I had to disable pear and iconv.

    Someone will come op with a fix sometime, I hope :)

  • Richard
    17 Nov 2007

    Sorry, I don't use both. When I've got some time I will look into it. It's now on the TODO list!

  • iamcam
    02 Dec 2007

    I've used the MAMP instructions from the Switching blog on Tiger, with good success, so I thought I'd make some modifications for Leopard. I'm doing this with a clean install of Leopard on a secondary drive so I can afford to screw things up.

    I was having the iconv problem until i moved the --with-iconv towards the top of the configure list. The compile went fine, but make test revealed several errors, some (most?) of which appear to be related to iconv, though not necessarily isolated to Leopard. make install worked fine.

    I don't know if these are even serious errors, so I don't know if I'm going to make the move to Leopard with this build, or wait another month or two until people get these problems worked-out... I just can't afford to have a partially working dev box.

    Richard, what are the FAIL results on your PHP make test? Mine are below.

    CPPFLAGS=-I/sw LDFLAGS=-L/sw \
     \
    CFLAGS=\\"-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk\\" \
    ./configure --prefix=/Library/PHP5 \
      --mandir=/usr/share/man \
      --infodir=/usr/share/info \
      --sysconfdir=/etc \
      --with-zlib \
      --with-xml \
     --with-iconv-dir=/sw \
      --with-zlib-dir=/usr \
      --with-openssl \
      --enable-zip \
      --enable-exif \
      --enable-ftp \
      --enable-mbstring \
      --enable-mbregex \
      --enable-soap \
      --enable-sockets \
      --with-curl \
      --with-curlwrppers \
      --disable-cgi \
      --with-gd \
      --with-jpeg-dir=/sw \
      --with-png-dir=/sw \
      --with-tiff-dir=/sw \
      --with-freetype-dir=/sw/lib/freetype219 \
      --with-mysql=/usr/local/mysql \
      --with-mysqli=/usr/local/mysql/bin/mysql_config \
      --with-pdo-mysql=/usr/local/mysql \
      --with-apxs2=/Library/Apache2/bin/apxs  \
    

    Failed results on make test

    =====================================================================
    TEST RESULT SUMMARY
    ---------------------------------------------------------------------
    Exts skipped    :   44
    Exts tested     :   35
    ---------------------------------------------------------------------
    Number of tests : 4616              3842
    Tests skipped   :  774 ( 16.8%) --------
    Tests warned    :    3 (  0.1%) (  0.1%)
    Tests failed    :   29 (  0.6%) (  0.8%)
    Tests passed    : 3810 ( 82.5%) ( 99.2%)
    ---------------------------------------------------------------------
    Time taken      :  308 seconds
    =====================================================================
    
    =====================================================================
    FAILED TEST SUMMARY
    ---------------------------------------------------------------------
    Bug #30638 (localeconv returns wrong LC_NUMERIC settings) (ok to fail on MacOS X) [tests/lang/bug30638.phpt]
    Bug #38474 (getAttribute select attribute by order, even when prefixed) (OK to fail with libxml2 < 2.6.2x) [ext/dom/tests/bug38474.phpt]
    Bug #42082 (NodeList length zero should be empty) [ext/dom/tests/bug42082.phpt]
    mysqli thread_id & kill [ext/mysqli/tests/071.phpt]
    Test array_fill() function : usage variations  - unexpected values for 'start_key' argument [ext/standard/tests/array/array_fill_variation1.phpt]
    Sort with SORT_LOCALE_STRING [ext/standard/tests/array/locale_sort.phpt]
    Test gettype() & settype() functions : usage variations [ext/standard/tests/general_functions/gettype_settype_variation2.phpt]
    Test chunk_split() function : usage variations - unexpected values for 'chunklen' argument(Bug#42796) [ext/standard/tests/strings/chunk_split_variation2.phpt]
    htmlentities() test 2 (setlocale / fr_FR.ISO-8859-15) [ext/standard/tests/strings/htmlentities02.phpt] (warn: possibly braindead libc)
    htmlentities() test 4 (setlocale / ja_JP.EUC-JP) [ext/standard/tests/strings/htmlentities04.phpt] (warn: possibly braindead libc)
    htmlentities() test 15 (setlocale / KOI8-R) [ext/standard/tests/strings/htmlentities15.phpt] (warn: possibly braindead libc)
    Test htmlspecialchars_decode() function : usage variations - unexpected values for 'quote_style' argument [ext/standard/tests/strings/htmlspecialchars_decode_variation2.phpt]
    Generic pack()/unpack() tests [ext/standard/tests/strings/pack.phpt]
    Test setlocale() function : basic functionality - setting system locale to a specific [ext/standard/tests/strings/setlocale_basic1.phpt]
    Test setlocale() function : basic functionality - set locale using an array [ext/standard/tests/strings/setlocale_basic2.phpt]
    Test setlocale() function : basic functionality - passing multiple locales as argument [ext/standard/tests/strings/setlocale_basic3.phpt]
    Test setlocale() function : usage variations - passing multiple valid/invlaid locales as argument [ext/standard/tests/strings/setlocale_variation1.phpt]
    Test setlocale() function : usage variations - setting system locale = 0 [ext/standard/tests/strings/setlocale_variation3.phpt]
    Test setlocale() function : usage variations - setting system locale as null [ext/standard/tests/strings/setlocale_variation4.phpt]
    Test setlocale() function : usage variations - Setting system locale as empty string [ext/standard/tests/strings/setlocale_variation5.phpt]
    Test sprintf() function : usage variations - hexa formats with float values [ext/standard/tests/strings/sprintf_variation35.phpt]
    Test sprintf() function : usage variations - int formats with float values [ext/standard/tests/strings/sprintf_variation4.phpt]
    Test sprintf() function : usage variations - unsigned formats with float values [ext/standard/tests/strings/sprintf_variation41.phpt]
    Test strcspn() function : usage variations - unexpected values of start argument [ext/standard/tests/strings/strcspn_variation3.phpt]
    Test strncasecmp() function : usage variations - unexpected values for 'len' [ext/standard/tests/strings/strncasecmp_variation5.phpt]
    Test strncmp() function : usage variations - different lengths(all types) [ext/standard/tests/strings/strncmp_variation5.phpt]
    Test strrpos() function : usage variations - unexpected inputs for 'offset' argument [ext/standard/tests/strings/strrpos_variation14.phpt]
    Test strrpos() function : usage variations - unexpected inputs for 'haystack', 'needle' & 'offset' arguments [ext/standard/tests/strings/strrpos_variation15.phpt]
    Test strspn() function : usage variations - unexpected values of start argument [ext/standard/tests/strings/strspn_variation3.phpt]
    Test vsprintf() function : usage variations - unsigned formats with unsigned values [ext/standard/tests/strings/vsprintf_variation15.phpt]
    Test vsprintf() function : usage variations - unsigned formats with signed and other types of values [ext/standard/tests/strings/vsprintf_variation16.phpt]
    Test vsprintf() function : usage variations - int formats with non-integer values [ext/standard/tests/strings/vsprintf_variation4.phpt]
    =====================================================================

    Please let me know if this worked for you, or if the fix seems reasonable. Also, if you have any thoughts about the failures I'd appreciate it. I know enough about compiling to get by, but not enough to know whether or not errors and failed tests are serious.

    Thanks!!
    ~Cameron

  • Richard
    02 Dec 2007

    lamcam, I haven't used iconv, the config statement in the documentation runs well on Leopard. There where if I remember correctly 2 failures on the test but they where minor. I will run it again this week and post the errors.

  • Richard
    09 Dec 2007

    I've checked the errors and I have the same, but I don't see any problems in using this version of PHP using Wordpress, postfixadmin, phpmyadmin as PHP based applications. If you do a make test, please let the script send a bug report, it will help...

  • macxpert
    31 Dec 2007

    I'm not sure if my problem is related, but I'm hoping someone here can help as I've been fighting this for literally 2 months straight....

    When I config and then make PHP on my system I get the following error:

    Undefined symbols:
      \"_EVP_CIPHER_CTX_block_size\", referenced from:
          _zif_openssl_seal in openssl.o
      \"_xmlTextReaderSchemaValidate\", referenced from:
          _zim_xmlreader_setSchema in php_xmlreader.o
      \"_xmlTextReaderSetup\", referenced from:
          _zim_xmlreader_XML in php_xmlreader.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make: *** [libs/libphp5.bundle] Error 1

    Here is the config command I used (top two lines added based on replies in this thread, but to no avail):

    CPPFLAGS=-I/sw LDFLAGS=-L/sw \
    CFLAGS=\\\"-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk\\\" \
    ./configure --prefix=/usr \
        --mandir=/usr/share/man \
        --infodir=/usr/share/info \
        --with-apxs2=/usr/sbin/apxs \
        --with-ldap=/usr \
        --with-kerberos=/usr \
        --enable-cli \
        --with-zlib-dir=/usr \
        --with-libxml-dir=/usr/local/include/libxml2 \
        --enable-exif \
        --enable-ftp \
        --enable-mbstring \
        --enable-mbregex \
        --enable-sockets \
        --with-iodbc=/usr \
        --with-curl=/usr \
        --with-config-file-path=/etc \
        --sysconfdir=/private/etc \
        --with-mysql-sock=/var/mysql \
        --with-mysqli=/usr/local/mysql-5.0.45-osx10.4-universal/bin/mysql_config \
        --with-mysql=/usr/local/mysql-5.0.45-osx10.4-universal \
        --with-pear \
        --with-openssl \
        --with-imap=/usr/local/imap-2007 \
        --with-imap-ssl \
        --with-mcrypt=/usr \
        --enable-embedded-mysqli=shared \
        --with-xmlrpc \
        --with-xsl=/usr

    Help please!

  • macxpert
    01 Jan 2008

    so after messing with far too many internal components (openssl libs in particular) and pretty much killing my system, I installed a clean copy of Leopard on another drive and experienced none of these same 'symbol(s) not found' problems.

    I think I'll start from scratch and reinstall everything instead of struggling with these odd problems now that I know a clean install works fine.

  • Richard
    02 Jan 2008

    Sorry, missed your earlier post. Hope all stays right and working...

  • marianopeterson
    19 Jan 2008

    I had the same problems with iconv and openssl. I found the following syntax solved the problem (I installed iconv and openssl using macports to /opt/local):

    --with-iconv=shared,/opt/local \
    --with-openssl=shared,/opt/local \

    Good luck.

Reply

You must log in to post.