Linux recompile install GD, add FreeType support, resolve CAPTCHA does not display problem, Fatal error:call to undefined function imagettftext ()

Source: Internet
Author: User
Tags gettext php source code


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


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 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 ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.