Re-configuring PHP with GD support

I've just astonished myself by managing to re-configure php without breaking anything (that I've found yet...). However, since I know from past experience that things don't usually go this well I figured here would be a good place to leave myself some instructions for next time. Maybe they will also help you, or maybe you know of a better way.

The aim:

To re-configure php with gd support so I can use the image capabilities of Drupal.

First:

Download gd from http://www.boutell.com/gd/

Unzip (gunzip filename)

Untar (? is that the write term ?) (tar xvf filename)

.configure
make
make install

Second:

Go to the original folder holding all the php source files.

./configure \
    --with-apxs2=/usr/local/apache/bin/apxs \
    --with-mysql \
    --prefix=/usr/local/apache/php \ 
    --with-config-file-path=/usr/local/apache/php \
    --enable-force-cgi-redirect \
    --disable-cgi \
    --with-zlib \
    --with-gettext \
    --with-gdbm \
    --with-gd=/root/gd/gd-2.0.33/

Where the last line is the new one pointing to the gd folder (containing gd.h) and the rest is in because it worked last time (really must get around to finding out what all that stuff actually does do!)

Originally this wouldn't work until I copied the file "libgd.so" from /usr/lib/ into the same folder as that containing gd.h, I guess it couldn't find it but as of yet don't know why, just know that this worked Smiling

Third:

Make
Make Install

Fourth:

/usr/local/apache/bin/httpd -k stop
/usr/local/apache/bin/httpd -k start

I have a feeling apache was already stopped as just using restart didn't work, if I do it again I will check... maybe I should have stopped apache before I updated php? Beee (Can you tell I don't do this much?)

Fifth:

Check php info file to make sure gd support was there and then tried out the drupal stuff as jaw dropped that the above had worked Smiling

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.