PHP5 With GD Support on OS X

Because I’ll Forget #15901:

Firstly, let me just say that compiling PHP has never been this difficult before. It shouldn’t be difficult at all actually. So heres the basic run down: I need SOAP, GD, SimpleXML and a few other miscellaneous extensions to make all my dev apps work properly — this went smoothly on the ppc laptop, and I (stupidly) assumed that the Intel would be even easier. My first couple attempts were splattered with GD errors driving me to the brink of insanity as I scrambled up all the pre-requisites. Finally, I had all dependencies met and the configure script STILL would not quit barfing on me. I gave up and finally just installed PHP without GD support (naturally ruining the one project I’m working on currently). I gave up, until I felt feisty enough to give it another shot.

The configure script was choking on a linking error (GD build test failed. Please check the config.log for details.) and kept telling me to hunt config.log for some answers. It turns out that ./configure was attempting to link with shell variables that were empty.

Looks something like “-L: directory name missing“.

The solution

Hacking my way through the configure file you get to the culprit.

LIBS=" -L$GD_LIB $GD_SHARED_LIBADD $LIBS"

Turns out that echo $GD_LIB is blank and being a major pain in the ass. To fix this, just edit the line to look more like: LIBS=" $GD_SHARED_LIBADD $LIBS". After that, try a make clean, rm config.cache and try to compile again. Hopefully this will save you a couple hours of hating life.

Resources:

My Configure Script
It might be beefed up in the future, but I’m just relieved to have it compiled & working right now — I’m exhausted

./configure --prefix=/usr/local/php5 \
 --mandir=/usr/share/man \
 --infodir=/usr/share/info \
 --sysconfdir=/etc \
 --enable-cli \
 --enable-soap \
 --with-ldap=/usr \
 --with-xml \
 --with-libxml-dir=/usr/local \
 --with-zlib \
 --with-zlib-dir=/usr \
 --with-openssl \
 --enable-exif \
 --enable-ftp \
 --enable-mbstring \
 --enable-mbregex \
 --enable-dbx \
 --enable-sockets \
 --with-curl=/usr \
 --with-mysql=/usr/local/mysql \
 --with-mysqli=/usr/local/mysql/bin/mysql_config \
 --with-apxs \
 --with-gd \
 --with-jpeg-dir=/usr \
 --with-png-dir=/usr \
 --with-freetype-dir=/usr \
 --with-xpm-dir=/usr


Comments

No comments yet.

Add Yours

  • Author Avatar

    YOU


Comment Arrow



About Author

Rob Hurring

Ruby, Rails, PHP, bash... oh my!