Drupal on Mac OS X Leopard and Apache/GD

I have been developing a couple of sites now using the Drupal CMS. It works great on Mac OS X, but there is one challenging aspect when trying to get the image manipulation functionality to work, as this needs the GD library but Apache as it is distributed with Mac OS X Leopard does not include that library. Most sites will tell you how to compile the GD library, however you will find for a mysterious reason your GD support will be FALSE. This article explains why and how to fix it. The reason it breaks - and it breaks only on Core 2 Duo MacBook's and Intel Xeon Mac Pro's - is because these operating systems are using the 64-bit version of Apache. So your compiler flags must be adjusted. So the steps are:

  1. Download libjpeg, extract and run:
  2. MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bindatload" ./configure --enable-shared
  3. then the normal make and make install
  4. Download PHP 5.2.4 source, extract, change directory to ext/gd and run:
  5. MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bindatload" ./configure --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6 --with-gd
  6. then the normal make and make install
  7. Add extension=gd.so to your php.ini file.
  8. Comment out the extension_dir = "./" like in php.ini
  9. Enable the php5_module in apache2's configuration (make sure you use /etc/apache2/http.conf as the other file located at /etc/httpd/httpd.conf is for an older version of Apache.)
  10. Should be all done now.

Super cool clips

I am not a fan of watching movie clips, but these are really cool.

Full Article

New website

It is clear from the looks of this site that some major changes happened.

I combined the old reef site with my blog site to create a single personal portal. There is still some work to do (especially on the About and Photography sections), but at least the major work has been done. Moving from Movable Type to my new platform was not trivial, as no straight migration path exists. This means I have lost all my comments. I believe this will not be a train smash, so if you miss them - I invite you to register and post some new ones :)

Stephen Hawking immortalized

I found this - and think it is awesome

I HATE Microsoft Access

Tonight I spent 3 hours trying to get a simple, basic SQL query to work in Microsoft Access 2003. The SQL query runs perfectly in Microsoft SQL Server 2005, however when run through the VB code in Access via the DAO layer it kept on failing with a syntax error. Obviously the error message did not point out the cause of the error. Since the SQL was perfectly valid and not complex, I was baffled.

Here is the basic query I had written:

select sum([table one].[field1]) from [table one] inner join [table two] on [table one].[field2] = [table two].[field2] inner join [table three] on [table three].[field3] = [table two].[field3] where [table one].[field4] > '2005-01-01'
Full Article