Image CAPTCHA requires FT fonts support

you need to change the php configure script to include --with-freetype-dir=/usr/lib64/ where /usr/lib64 contains the libfreetype.so file.

My final configuration so far looks like:

./configure --with-apxs2=/usr/bin/apxs --enable-bcmath --with-curl --with-gd \
--with-jpeg-dir=/usr/lib64/ --with-png-dir=/usr/lib64/ --with-freetype-dir=/usr/lib64/ \
--enable-intl --enable-mbstring --with-mcrypt --with-mhash --with-openssl \
--with-pdo-mysql --enable-soap --with-xsl --enable-zip --enable-opcache  --with-config-file-path=/etc

then you need to make;make install; and restart the web server.


I found fix for development environment, because I use Mac OS and the apache php doesn't support these fonts and it's a lot of work to get it working and not mess up my system.

open vendor/zendframework/zend-captcha/src/Image.php and add return in the constructor after the parent is called like this

/**
 * Constructor
 *
 * @param  array|\Traversable $options
 * @throws Exception\ExtensionNotLoadedException
 */
public function __construct($options = null)
{
    parent::__construct($options);
    return;

    if (! extension_loaded("gd")) {
        throw new Exception\ExtensionNotLoadedException("Image CAPTCHA requires GD extension");
    }

    if (! function_exists("imagepng")) {
        throw new Exception\ExtensionNotLoadedException("Image CAPTCHA requires PNG support");
    }

    if (! function_exists("imageftbbox")) {
        throw new Exception\ExtensionNotLoadedException("Image CAPTCHA requires FT fonts support");
    }
}