Install GD library and freetype on Linux
119,701
Solution 1
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
Solution 2
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
Solution 3
For CentOS: When installing php-gd you need to specify the version. I fixed it by running: sudo yum install php55-gd
Solution 4
Installing freetype:
sudo apt update && sudo apt install freetype2-demos
![C A Mc](https://i.stack.imgur.com/7jwpC.jpg?s=256&g=1)
Author by
C A Mc
Updated on February 01, 2020Comments
-
C A Mc over 4 years
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 ?
-
C A Mc over 10 yearsI'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 over 10 yearsfreetype won't work, it says it is unable to locate package freetype
-
Alireza Fallah over 10 yearsIm not using ubunto to test it, but its my first result of search
how to install freetype in ubunto
. you can search too -
k__gc_im_o_ almost 10 yearswrite freetype* instead of freetype
-
Paul almost 10 yearsIn 14.04 LTS, installing php5-gd took care of Freetype as well (so only php5-gd needed to be installed).
-
k__gc_im_o_ almost 10 yearsI 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"
-
Dave Hilditch over 9 yearsThis is why my Wordpress thumbnails weren't being built
-
Alireza Fallah over 9 years@DaveHilditch - Yes, you have to install it for generating wordpress thumbnails.
-
rebellion over 8 yearsDo you have to activate the module for PHP also?
-
Alireza Fallah over 8 years@ronnyandre, no, you dont need to
-
Andrew over 8 yearsdon't forget to restart apache: sudo service apache2 restart
-
eQ19 over 8 yearsI'm on aws linux with PHP Version 5.6.17
sudo yum install php56-gd
works on my site. Thanks. -
ch271828n over 3 years
apt-get install libfreetype6-dev
works for me!