apt-get install php5-gd
simnle use
# yum search php-
#Different Editing on php.ini
vim /etc/php5/apache2/php.ini
or
vim /etc/php5/cli/php.ini
or
vim /etc/php5/fpm/php.ini
#Add this extensions on your php.ini
extension=gd.so
#Restart your Server
service apache2 restart
or
service nginx restart
service php5-fpm restart