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