今天在调试一个项目的验证码的时候,返回Call to undefined function Think\imagettftext() 错误位置 这个错误。
网上的资料都说要重新安装php ,编译时添加 --with-freetype-dir=/usr/local/freetype --enable-gd-native-ttf 这些参数。
我试了一下,重新安装php,结果还是不行,gd还是没有支持freetype。
然后,我在添加gd扩展时,添加--with-freetype-dir=/usr/local/freetype --enable-gd-native-ttf 这些参数。
重新make ,makeinstall gd 的so文件。
此时问题解决。在phpinfo页面看到gd支持freetype