Imagettftext is a graphic processing function. If you encounter Calltoundefinedfunctionimagettftext () when using the imagettftext function, the function component is not opened, so we only need simple configuration. Imagettftext is a graphic processing function. If you encounter Call to undefined function imagettftext () when using the imagettftext function, the function component is not opened, so we only need simple configuration.
Script ec (2); script
When Tipask v2.5 is installed in a new environment, the backend Verification Code cannot be displayed. The wrong function is imagettftext (). The error is hidden due to index. php's use of error_reporting (0). This inexplicable error is removed and the error immediately appears:
Fatal error: Call to undefined function imagettftext ()
Now we have made it clear that the cause of the error is that FreeType is not added during PHP compilation.
Solution
First, compile and install 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
Next we will re-compile PHP and add the parameter-with-freetype-dir =/usr/local/freetype.
./Configure-with-freetype-dir =/usr/local/freetype
Compile and restart php
Kill-USR2 'cat/usr/local/php/var/run/php-fpm.pid'
Find FreeType Support in the GD library to indicate that the installation is successful!
Note that if the server freetype version is 1. *, you may need to change the compilation parameter to-with-ttf [= DIR ].