41

I'm trying to use imagefttext. And I need to have GD library and/or freetype installed. I'm new to this kind of stuffs, How can I install GD library and freetype in Linux ?

Alireza Fallah
  • 4,609
  • 3
  • 31
  • 57
C A Mc
  • 449
  • 1
  • 4
  • 7
  • 1
    Which Linux distribution are you using? – Lee Duhem Jan 19 '14 at 11:35
  • 1
    You should mention that, different Linux distribution use different [package management system](http://en.wikipedia.org/wiki/Package_management_system), for example, Fedora/CentOS use 'Yum', Debian/Ubuntu use 'Apt'. – Lee Duhem Jan 19 '14 at 12:00

4 Answers4

75

Installing GD :

For CentOS / RedHat / Fedora :

sudo yum install php-gd

For Debian/ubuntu :

sudo apt-get install php5-gd

Installing freetype :

For CentOS / RedHat / Fedora :

sudo yum install freetype*

For Debian/ubuntu :

sudo apt-get install freetype*

Don't forget to restart apache after that (if you are using apache):

CentOS / RedHat / Fedora :

sudo /etc/init.d/httpd restart

Or

sudo service httpd restart

Debian/ubuntu :

sudo /etc/init.d/apache2 restart

Or

sudo service apache2 restart
Alireza Fallah
  • 4,609
  • 3
  • 31
  • 57
14

Things are pretty much simpler unless they are made confusing.

To Install GD library in Ubuntu

sudo apt-get install php5-gd

To Install Freetype in Ubuntu

sudo apt-get install libfreetype6-dev:i386
XIMRX
  • 2,130
  • 3
  • 29
  • 60
2

For CentOS: When installing php-gd you need to specify the version. I fixed it by running: sudo yum install php55-gd

Mithun Billara
  • 140
  • 1
  • 6
  • 1
    I'm on aws linux with PHP Version 5.6.17 `sudo yum install php56-gd` works on my *[site](http://forum.tophyips.info/)*. Thanks. – eQ19 Feb 04 '16 at 14:04
1

Installing freetype:

sudo apt update && sudo apt install freetype2-demos

IMAN4K
  • 1,265
  • 3
  • 24
  • 42