Miscellaneous > Technical Support

PHP build chokes

(1/3) > >>

worker201:
Of course OSX has php built-in.  But of course it isn't built with postgresql support, which I need for a project.  So I'm trying to build my own version and failing.  Here are some of the lurid details.

PHP version - 5.3.1

Configure:

--- Code: ---./configure --prefix=/usr/local/php5 --with-libxml-dir=/opt/local
--enable-exif --with-openssl=/opt/local --with-zlib --with-zlib-dir=/opt/local
--with-bz2=/opt/local --with-curl=/opt/local --with-jpeg-dir=/opt/local
--with-png-dir=/opt/local --with-freetype-dir=/opt/local --with-openssl-dir=/opt/local
--with-gettext=/opt/local --with-mysql=/usr/local/mysql --with-pgsql=/Library/PostgreSQL/8.4/bin
--enable-soap --with-xsl=/opt/local --enable-shared --enable-static --with-iconv-dir=/usr/local/libiconv
--- End code ---
Most of the stuff needed was installed with MacPorts, which keeps everything in /opt/local.  Originally, libiconv was there also, but I thought it might be the problem, so I built my own version from source.

The relevant part of the make process:

--- Code: ---Undefined symbols:
  "_iconv_close", referenced from:
      _php_iconv_string in iconv.o
      _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/cgi/php-cgi] Error 1

--- End code ---

Supposedly, I can build --without-iconv.  Would that be wise?  Any other suggestions?

worker201:
Thanks for all your help, guys.  As it turns out, this is a known bug in the libiconv included in Leopard.  The workaround is to use --with-iconv=shared,[dir] instead of --with-iconv-dir=[dir].  This has something to do with bypassing the search path and forcing the linker to skip over the built-in libiconv in favor of the aftermarket version.  I was able to build successfully using the libiconv from MacPorts, so I can go ahead and remove that GNU source version I built.

worker201:
Oops, I forgot something:
--with-apxs2=/usr/sbin/apxs

Yes, I'm talking to myself.  But maybe this will help someone, eventually.

Aloone_Jonez:
Lol, I did read this thread.

All I have to say is that I have no clue as I don't know any PHP but I thought I'd respond in the hope it'll make you feel better as it is frustrating when you think no one's listening. :)

piratePenguin:
How many mac os x software compiling people come on this forum every day to respond to threads? :s

Navigation

[0] Message Index

[#] Next page

Go to full version