Problems compiling PHP 5.3.19 on Mountain Lion

I had to add EXTRA_CFLAGS = -lstdc++ -lresolv to Makefile when trying to compile PHP 5.3.19 with:

./configure --prefix=/usr/local --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/private/etc --enable-cli --with-config-file-path=/usr/local/php/etc --with-libxml-dir=/usr --enable-xml --enable-exif --enable-ftp --with-gd --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --enable-gd-native-ttf --with-imap=/usr/local --with-imap-ssl --enable-magic-quotes --enable-mbstring --enable-mbregex --enable-json --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/tmp/mysql.sock --with-iodbc=/usr --enable-shmop --enable-sockets --enable-fpm --with-mhash --with-mcrypt --with-xmlrpc --enable-xmlwriter --enable-xmlreader --with-xsl=/usr --enable-zend-multibyte --enable-zip --with-pcre-regex=/usr/local --with-pdo-sqlite --enable-pdo --with-freetype-dir=/usr/local --enable-dom --enable-fileinfo --with-kerberos --with-pgsql=/Applications/Postgres.app/Contents/MacOS --with-pdo-pgsql=/Applications/Postgres.app/Contents/MacOS --with-curl --with-gettext --with-zlib --with-tidy --enable-pcntl --enable-hash --enable-mbregex --with-regex=php --enable-bcmath --enable-sqlite-utf8 --enable-intl

Otherwise I had errors with Intl (ICU) and cUrl together, something like :

Undefined symbols for architecture x86_64
_res_9_dn_expand etc...

This was on OSX Mountain Lion.
Coworker reports it also works on old Lion :p

This entry was posted in mac, php. Bookmark the permalink.

2 Responses to Problems compiling PHP 5.3.19 on Mountain Lion

  1. endeveit says:

    Hi, why don’t you use package manager for Mac?
    Like homebrew (http://mxcl.github.com/homebrew/) for example.
    It is a much more better way than to build sources manually.