PHP GD 图库报错:error: Call to undefined function imagettftext()
原因是确少 freetype
1.安装freetype
下载最新版的 [freetype](https://www.freetype.org/download.html "freetype") 解压 编译 安装:
tar -zxvf freetype-2.9.1.tar.gz
cd reetype-2.9.1
# 安装到/usr/local/freetype
./configure --prefix=/usr/local/freetype
make && make install
2.重新编译安装 gd
首先要 make clean;这个很重要
#先进入 PHP 源码包中的 ext/gd/ 下
make clean
phpize
./configure --with-freetype-dir=/usr/local/freetype
make && make install
如果是首次安装 gd 需要在 php.ini 中开启 gd.so