Installing GD for PHP

by Kevin Partner on 22nd October, 2007

I have to admit that my knowledge of Linux is pretty basic and it was tested to the limit when I wanted to add image manipulation to my PHP code. This requires the “GD” library to be accessible by PHP. The important thing to remember here is that, in most recent PHP installations, the capability is already there and all you’ve got to do is enable it. My webserver runs the Fedora flavour of Linux. If you’re the same, here’s what to do.
Firstly, you need to be able to get to your server’s command line. I used a tool called BitVise Tunnelier for this as it includes a file explorer interface as well as the command line.

Once you’re logged in as root,  type:

yum install php-gd

This will start the process off. Linux may have to download further files but all this requires is for you to confirm when prompted.

Once it’s done, type

rpm -q php-gd

…and you should see something like  “Installed: php-gd.i386 0:5.1.6-3.3.fc6″.

Finally, type

service httpd restart

This restarts the http server which forces PHP to load the module. All should now be well and you can forget about it!!

Share and Enjoy:
  • Print
  • Twitter
  • Facebook
  • Digg
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Add to favorites

Leave a Comment

Previous post:

Next post: