Mac--PHP已经开启gd扩展验证码不显示

错误显示:Call to undefined function imagettftext()

原因:

mac系统中自带的php的gd库中,缺少对freetype的支持,导致图片无法显示。

解决:

1 下载freetype,安装即可

下载地址:https://download.savannah.gnu.org/releases/freetype/

下载完成后编译安装

make clean

./configure --with-static --with-shared

make & make install

2 安装一个新的版本的PHP

url -s http://php-osx.liip.ch/install.sh | bash -s 7.2

 可能会出警告提示:

Detected macOS Mojave 10.14. There are serious issues with it, due to the original apache not loading
foreign libraries anymore. PHP within apache will most certainly not work anymore if you proceed!
The cli version still will.
See this issue at https://github.com/liip/php-osx/issues/249 for details and discussion
****
Restart this script with
 curl -s https://php-osx.liip.ch/install.sh | bash -s force 7.1
to really install it

 大概意思为apache没有加载,如果继续的话PHP将不会在工作,直接忽略 执行下面提示的命令

curl -s https://php-osx.liip.ch/install.sh | bash -s force 7.1

 或者可以通过brew的方式安装,参考下面链接

https://www.cnblogs.com/jingxiaoniu/p/11102255.html

 

以上就是这次的全部内容!

转载于:https://www.cnblogs.com/jingxiaoniu/p/11114661.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值