1

This post is meant to help those using CircleCI as current posts on SO just say "recompile with freetype" and don't provide any details for CircleCI.

Our unit tests use PHP GD and the PHP binary on the circleci servers has not been compiled with freetype so we get errors like:

Fatal error: Call to undefined function imagettftext()

CircleCI support says they may fix this in the future, but in the meantime we need to recompile PHP with freetype. How can we do this?

redgeoff
  • 3,163
  • 1
  • 25
  • 39
  • 1
    Possible duplicate of [Compile PHP Error with freetype](http://stackoverflow.com/questions/2751203/compile-php-error-with-freetype) – user23573 Oct 28 '15 at 19:31
  • Possible duplicate of [PHP Fatal error: Call to undefined function imagettftext()](http://stackoverflow.com/questions/7290958/php-fatal-error-call-to-undefined-function-imagettftext) – Davide Pastore Oct 28 '15 at 19:39
  • This post is meant to help those using CircleCI as current posts on SO just say "recompile with freetype" and don't provide any details for CircleCI. – redgeoff Oct 30 '15 at 16:25

1 Answers1

2

the following worked for me (using the circleci/php:7.3.6-fpm-stretch-browsers image):

sudo apt-get install libfreetype6-dev

sudo docker-php-ext-configure gd --with-freetype-dir=/usr/include/freetype2/

before installing the gd extension with

sudo docker-php-ext-install intl gd

the link that led me to the solution: https://docs.docker.com/samples/library/php/ (PHP Core Extensions section)

lackovic10
  • 994
  • 1
  • 8
  • 11