When loading Tipask v2.5 in a new environment, it was found that the background captcha could not be displayed. The error function is Imagettftext (), because index.php use error_reporting (0) will be wrong to hide, leading to this inexplicable error, remove, error immediately appear:
Fatal error:call to undefined function imagettftext ()
Now we have made it clear that the reason for the error is that PHP did not add freetype at compile time.
Solutions
First compile the installation FreeType, take 2.4.0 as an example:
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.bz2
TAR-JXF freetype-2.4.0.tar.bz2
CD reetype-2.4.0
# Install to/usr/local/freetype
./configure–prefix=/usr/local/freetype
Make && make install
Here we recompile PHP, plus the parameters –with-freetype-dir=/usr/local/freetype
./configure–with-freetype-dir=/usr/local/freetype
Compile Complete reboot PHP
KILL-USR2 ' Cat/usr/local/php/var/run/php-fpm.pid '
And then the GD library to find FreeType support instructions installation success!
Note that if the server FreeType version is 1.*, then you may need to change the compilation parameters to –with-ttf[=dir], and the following will be transferred from the Chinaunix forum:
Font configuration Switch
FreeType 1.x to activate FreeType 1.x support, plus –with-ttf[=dir].
FreeType 2 to activate FreeType 2 support, plus –with-freetype-dir=dir.
T1lib to activate T1lib (Type 1 font), plus –with-t1lib[=dir].
Local TrueType String functions to activate support for local TrueType string functions, plus –enable-gd-native-ttf.