php安装freetype的方法:首先执行命令“make && make install”安装freetype;然后安装gd包括freetype;接着切换到php ext源码目录;最后重启php服务即可。
推荐:《php视频教程》
php fatal error: call to undefined function imagettftext()错误提示是指gd库中缺少freetype库,你装了gd不一定就支持freetype,很多人理解错误,freetype 不是一个独立的扩展,是附着在gd库上的。freetype官方下载地址:https://www.freetype.org/download.html
第一步安装freetype
./configure --prefix=/usr/local/freetypemake && make install第二步安装gd包括freetype
切换到php ext源码目录
/opt/php5/bin/phpize./configure --with-php-config=/opt/php5/bin/php-config --with-jpeg-dir=/usr/local/jpeg/lib --with-freetype-dir=/usr/local/freetype --enable-gd-native-ttfmake && make install如果需安装 gd支持jpeg请参见 https://blog.csdn.net/coolpan123/article/details/72916802
如果没有安装过gd 把gd.so 写入php.ini
如果以前装过gd 直接重启php服务即可