I am using ubuntu 11.04 and when I am opening terminal and typing php -a it is showing some error like this
php -a
PHP Warning: PHP Startup: Unable to lo
Probably something like
sudo apt-get install php-gd
should do it, if not try
apt-cache search php | grep gd