本地的GD库不支持freetype,编译扩展没用,只好重新编译Php了
进入php源码
执行:
./configure --prefix=/usr/local/php --enable-fpm --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysqli --with-mysql-sock --with-gd --enable-gd-native-ttf --enable-pdo --with-pdo-mysql --with-gettext --with-curl --with-pdo-mysql --enable-sockets --enable-bcmath --enable-xml --with-bz2 --enable-zip --with-freetype-dir=/usr/local/freetype --with-libxml-dir=/usr/local/libxml2 --with-zlib-dir=/usr/local/zlib --with-curl=/usr/local/curl --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/png --with-mcrypt=/usr/local/libmcrypt --with-apxs2=/usr/sbin/apxs
然后:make ZEND_EXTRA_LIBS='-liconv' (这个不加的话,后面会报错)
make test
make install
搞定: