Install GD library and freetype on Linux

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 ?

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

To install yum for Ubuntu, use the command apt-get install yum. On the other hand, the php5-gd package in Ubuntu and Debian should include support (via dependencies) for Freetype as well. In that case, use apt-get install php5-gd to install Freetype and GD libraries (along with support for them in PHP5) in a single action. 0

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

FreeType, a freely available software library to render fonts, has reached the 2.8 release. Here’s how to install it via PPA in Ubuntu. FreeType 2.8 features complete support for CFF2 and OpenType Variation Fonts, a new function `FT_Face_Properties’, 25 more scripts added to the auto-hinter, and various fixes.

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

The GD Graphics Library for dynamically manipulating images. You will need to compile PHP with the GD library of image functions for this to work. However. Ubuntu (and Debian) Linux comes with the package called php5-gd. Just type the following command to install this module: # apt-get install php5-gd. OR.

Installing freetype:

sudo apt update && sudo apt install freetype2-demos

add freetype support to your website compile php with freetype support easy apache freetype enable freetype enable freetype gd enable freetype on linux free type support freetype directadmin freetype enable freetype functions freetype installation freetype linkage freetype support freetype support install freetype support php gd and freetype

Trying to install GD dependencies on alpine linux in docker. I'm building php5-fpm-alpine image. FROM php:5-fpm-alpine RUN docker-php-ext-install mysql RUN apk upgrade --update && apk add \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcr

Hi, Im trying use PHP 7.4 with GD with JPEG and FreeType support. But i don't know why it is not enabled. Code: php -r 'print_r(gd_info());' Array ( [GD Version] => bundled (2.1.0 compatible) [FreeType Support] => [GIF Read Support] => 1

If you are using PHPBREW , the extension is called gd. So you do. ``` phpbrew ext install gd ``` It will compile the extension to the core.

Comments
  • Which Linux distribution are you using?
  • You should mention that, different Linux distribution use different package management system, for example, Fedora/CentOS use 'Yum', Debian/Ubuntu use 'Apt'.
  • freetype won't work, it says it is unable to locate package freetype
  • Im not using ubunto to test it, but its my first result of search how to install freetype in ubunto . you can search too
  • write freetype* instead of freetype
  • I 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"
  • This is why my Wordpress thumbnails weren't being built
  • In 14.04 LTS, installing php5-gd took care of Freetype as well (so only php5-gd needed to be installed).
  • I'm on aws linux with PHP Version 5.6.17 sudo yum install php56-gd works on my site. Thanks.