Adding GD Support to PHP in Mac OS 10.5.5

So you just got a sweet new MacBook Pro, turned on your web server, uncommented the PHP include, got mySQL up and running and talking to PHP and Apache through the proper socket. You are awesome, but you don't stop there. You install Drupal 6+ and get a big fat error on the first page, "You Don't have GD support." Ouch, but don't worry, I am here to hold your hand.

  • Open Terminal App : You will need to have Apple Developer Tools installed to have the terminal available to you. It is on a CD/DVD that came with your computer and is also available for free download.
  • Enter the following commands : If you are unsure what any of these commands mean or you don't trust me, you can get a manual entry for almost all command line commands by entering 'man <commandname>'. The command 'sudo' allows you to become the superuser and get past any permission checks for one command after you enter an administrator password.
    • cd /private/etc/apache2 : move to the Apache2 configuration directory
    • sudo pico httpd.conf : This opens Apache's configuration file in a text editor called Nano, feel free to use vi or emacs if you know what you are up to.
      • find the line "LoadModule php5_module libexec/apache2/” and add a ”#” (no quotes) at the front of the line : This will comment out Leopard's default PHP5 library. In Nano you can use control+w to find and control+x to save and exit.
    • cd /usr/local : Change working directories.
    • sudo curl -O : Download a copy of PHP that has all the extensions you are looking for already installed.
    • sudo tar -xvzf php5-*-beta.tar.gz : Verbosely unzip and detar the download.
    • sudo ln -sf /usr/local/php5/entropy-php.conf /etc/apache2/other/+entropy-php.conf : Create a symbolic link to the new PHP package so that Apache can find it.
    • sudo apachectl restart : Restart Apache.
  • smile : You should be proud of yourself.

I assume no responsibility for the any damage you presume this caused your install.


Post new comment

  • Allowed HTML tags: <em> <strong>
  • Lines and paragraphs break automatically.

More information about formatting options

Enter the characters shown in the image.