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

 

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

posted @ 2019-07-02 22:18  静小妞  阅读(1330)  评论(1编辑  收藏  举报