Problem:
Fatal error:call to undefined function think\imagettftext () in/var/www/webreg/thinkphp/library/think/ Verify.class.php on line 143
See Phpinfo () and learned that GD does not have freetype support
Solve:
First install freestyle,php-gd
Ensure that freestyle is installed first, then PHP-GD, and if PHP-GD is installed first, after installing freestyle, make clean is required. . (It's important to get a lot of this,,, here)
Then reconfigure the compilation parameters as follows:
1. To "Your PHP source code extract Directory"/EXT/GD
Make Clean./configure--with-mysql--prefix=/homewww/php--with-apxs2=/homewww/httpd/bin/apxs-- with-config-file-path=/homewww/php/conf--WITH-GD--enable-exif--enable-gd-native-ttf-- Enable-inline-optimization--with-zlib--with-png-dir--with-jpeg-dir=/usr/local/jpeg--with-freetype-dir=/usr/ Local/lib--with-ttf--enable-mbstring--with-gettext--enable-gd-jis-convmake && make install2. Following success, installing shared extensions: /homewww/php/lib/php/extensions/no-debug-zts-20100525/ This way the newly compiled gd.so will need the CP to the EXTENSION_DIR directory configured in your php.ini under this path. 3. Take Apache for example, restart Apache,service httpd restart 4. In addition, it may be libjpeg libpng zlib These causes, follow the instructions installed after the compilation can be. These dependent libraries include FreeType, PHP-GD can be installed by Yum install
Long time no record of things, hope to help the later encounter problems of friends ...
---------------- Attach the full PHP compilation parameters:-------------------------------------------------------------------------- ----------------------------------------------------------------
./configure--prefix=/homewww/php--with-apxs2=/homewww/httpd/bin/apxs--with-config-file-path=/homewww/php/conf- -with-mysql--with-mysqli--with-mysql-sock--enable-pdo--with-pdo-mysql--with-gd--with-iconv --with-zlib-- Enable-xml--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--enable-mbregex-- Enable-mbstring--enable-gd-native-ttf--with-openssl--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip-- Enable-soap--without-pear--with-gettext--enable-session--with-jpeg-dir=/usr/local/jpeg--with-freetype-dir-- WITH-PNG-DIR=/USR/LOCAL/PNGP--with-bz2 \
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Linux recompile install GD, add FreeType support, resolve CAPTCHA does not display problem, Fatal error:call to undefined function imagettftext ()