Installing PHP GD support on OS X

Installing PHP GD support on OS XNote: this is for OSX 10.4 Tiger, if you are on Leopard: tutorial for installing GD support on 10.5 Leopard.

I’m sure the people at Apple had a good reason not to include the GD library in the default apache/PHP installation that comes with OS X. Too bad though, because sooner or later you’ll need it when using OS X as a web development platform. Getting it running is not much like the 1.2.3 installing procedures you are used to on a mac, but here’s how to do it.Since I’m not really a black belt console ninja, it took me quite a while to figure out how to install GD, and how to make it available in PHP. This step by step how-to finally helped me out. To make it work make sure:

  • you have Xcode Tools installed (it’s on your OS X installation disc)
  • you use a PHP 4.x source file, this how-to will not work with the 5.x source. The article uses 4.4.4 but 4.4.7 works as well.
  • you use “/usr/lib/php/extensions/no-debug-non-zts-20020429/gd.so” as the path to the extenstion in your php.ini file instead of just “gd.so”. See the last comment by John Kirn.

Happy local automated image generating!By the way, another big thing lacking for us web developers on OS X is a MySQL server installation. Compared to GD this is relatively easy to install, but if you’re having trouble, you might want to concider using MAMP.

Comments

(will not be visible)
Previous article:
Tag suggestions