Call to undefined function imagettftext () solution, calltoundefined
Published by laogu on in code life classification
When DEDECMS is installed in a new environment, the background Verification Code cannot be displayed. Search for this error directly. Some people say that the session is wrong, some say that the permission is wrong, and so on. Isn't that bullshit! You can only view the source code and locate the file./include/vdimgck.php
. The error function isimagettftext()
Due to the use of zhimeng@
This inexplicable error is caused by hiding the error. Set@
Remove, 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.bz2tar-jxf freetype-2.4.0.tar.bz2cd reetype-2.4.0 # install to/usr/local/freetype./configure -- prefix =/usr/local/freetypemake & make install
Next we will re-compile PHP with Parameters--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`
FindFreeType Support
The installation is successful!
Note that if the server freetype version is 1. *, you may need to change the compilation parameter--with-ttf[=DIR]
, Below