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 ?
Asked
Active
Viewed 1.3e+01k times
41
-
1Which Linux distribution are you using? – Lee Duhem Jan 19 '14 at 11:35
-
1You 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 Answers
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
-
I'm using ubuntu, so I just tried this with 'sudo apt-get install php5-gd'. However, it says PHP-GD is already the newest version. I'm guessing this means i have the GD library installed, so now I just need to enable Freetype somehow. The php wiki has this "To enable support for FreeType 2 add --with-freetype-dir=DIR ." but I have no idea what that means. – C A Mc Jan 19 '14 at 11:36
-
1
-
1Im not using ubunto to test it, but its my first result of search `how to install freetype in ubunto` . you can search too – Alireza Fallah Jan 19 '14 at 12:11
-
4
-
1I don't know either, You should ask it from the person who add it on the repository. For all I know It maybe there under the name of "freetype*" instead of "freetype" – k__gc_im_o_ Aug 30 '14 at 09:31
-
1
-
@DaveHilditch - Yes, you have to install it for generating wordpress thumbnails. – Alireza Fallah Nov 26 '14 at 10:48
-
-
-
1
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
-
1In 14.04 LTS, installing php5-gd took care of Freetype as well (so only php5-gd needed to be installed). – Paul Jul 22 '14 at 00:19
-
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
-
1I'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