Fatal error: Call to undefined function imagettftext()解决办法
Posted on 2016-04-11 00:57 Showker 阅读(467) 评论(0) 编辑 收藏 举报我的问题是php编译安装时指定了gd的目录,其实不用指定。就可以了
问题描述:phpcms 安装后,不能看到验证码图片。
解决:确保php-gd和freestyle.而且确保是先安装了freestyle,然后是php-gd;如果是先安装了php-gd,那么在安装完freestyle后,需要make clean 然后重新configure php with freestyle option,我的如下:
./configure \
--with-mysql \
--with-apxs2=/app/deploy/apache/bin/apxs \
--with-gd \
--enable-exif \
--enable-gd-native-ttf \
--enable-inline-optimization \
--with-zlib \
--with-png-dir \
--with-jpeg-dir=/usr/local/jpeg6 \
--with-freetype-dir=/usr/local/lib \
--with-ttf \
--enable-mbstring \
--with-gettext \
--enable-gd-jis-conv
另外,php-gd可以通过yum install php-gd安装。
最后通过phpinfo()看到的gd信息应该如下:
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.4.5
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
JIS-mapped Japanese Font Support enabled
解决:确保php-gd和freestyle.而且确保是先安装了freestyle,然后是php-gd;如果是先安装了php-gd,那么在安装完freestyle后,需要make clean 然后重新configure php with freestyle option,我的如下:
./configure \
--with-mysql \
--with-apxs2=/app/deploy/apache/bin/apxs \
--with-gd \
--enable-exif \
--enable-gd-native-ttf \
--enable-inline-optimization \
--with-zlib \
--with-png-dir \
--with-jpeg-dir=/usr/local/jpeg6 \
--with-freetype-dir=/usr/local/lib \
--with-ttf \
--enable-mbstring \
--with-gettext \
--enable-gd-jis-conv
另外,php-gd可以通过yum install php-gd安装。
最后通过phpinfo()看到的gd信息应该如下:
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.4.5
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
JIS-mapped Japanese Font Support enabled