Tuesday, February 03, 2009

installing PHP with GD on OS X

I was quite disappointed when realized that the apache+php coming with OS X was without the GD libs compiled in...

A complete recompile of both programs is needed, but this guy decided to help:
from here you can dowload an updated version of php precompiled, with some libraries included... se his pages for more details.

Apache, as usual from http://httpd.apache.org...

I paraphrased MArk's advices for compiling Apache:
CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i686" sudo ./configure --prefix=/opt/apache2 --enable-mods-shared=all --enable-proxy-balancer --enable-proxy-ajp --enable-proxy-http --enable-proxy-ftp --enable-proxy-connect --enable-proxy --enable-ssl --enable-so

I've changed the location of the brand new sdk, removed the 386 arch, the ppc arch and added the i686 arch.

sudo make
sudo make install

sudo shouldn't be really necessary 'til the last step, but shouldn't harm much.

Created a conf/other directory for my configurations,
added an Include directive in the main .conf file,
added the php.conf as described in the entropy.conf

Unfortunately a nasty error message appeared on starting up the web server on a missing lib...

I needed to:
696 cd /opt/apache2/
697 sudo mkdir lib
698 cd lib
699 sudo ln -s /opt/local/lib/libexpat.0.dylib .
create the missing dir, creating a symlink to the missing library to resolve this. Dumb working solution.

No comments: