call to undefined function imagettfbbox

From WebHostingNeeds.com
Jump to: navigation, search
# php captcha.php
PHP Fatal error:  Call to undefined function  imagettfbbox() in /home/user/public_html/captcha.php on line 38
#

This error is due to PHP is not compiled with freetype. Reconfigure PHP with option

--with-freetype-dir=
# ./configure --help |grep free
  --with-freetype-dir[=DIR] GD: Set the path to FreeType 2 install prefix
                          directory [/usr/local/freetds]
#


HOW TO INSTALL FreeType

cd /usr/local/src
wget http://jaist.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.5.tar.gz
tar -zxvf freetype-2.3.5.tar.gz
cd freetype-*
./configure --prefix=/usr/local
make
make install

On configuring php, add the line

--with-freetype-dir=/usr/local