yosemite php gd,Yosemite下配置PHP支持GD库FreeType

Mac升级系统到 Yosemite 10.10,偶然发现验证码不显示了,php -m

发现有GD库,但没有发现FreeType。

安装 FreeType

前往苹果官方开源支持:http://www.apple.com/opensource/ 查找并下载GD需要的

zlib/libpng/jpeg/freetype/libgd,这里提供一个包及执行脚本:

解压,安装

cd gd

sudo ./install

此时,已经安装完freetype,但需要重新编译PHP,添加 FreeType

支持,否则在PHP上仍然不能获得Freetype支持……

重新编译PHP

查看自己PHP版本,Yosemite应该是PHP5.5.14,下载地址百度网盘

下载解压后移动到/usr/local/php 并进行编译

./configure --prefix=/usr/local/php

--with-config-file-path=/usr/local/lib --with-apxs2=/usr/sbin/apxs

--with-mysql --with-zlib --enable-mbstring --enable-xml

--with-mcrypt=/usr/local/mcrypt --with-gd

--with-jpeg-dir=/usr/local/opt/jpeg --with-png-dir

--with-freetype-dir=/usr/local/opt/freetype

make && make install

出现一下错误,表示编译路径不对

configure: WARNING: unrecognized options: --with-config-file-path,

--with-apxs2, --with-mysql, --with-zlib, --enable-mbstring,

--enable-xml, --with-gd, --with-jpeg-dir, --with-png-dir,

--with-freetype-dir

./configure: line 2481: syntax error near unexpected token

`config.nice'

./configure: line 2481: `PHP_CONFIG_NICE(config.nice)'

出现以下错误 ./configure: No such file or directory

一般情况下,多看看目录下的readme和INSTALL文件,里面会告诉你怎么安装软件。

目录下没有configure,但有configure.am或configure.in时,需要用autoconf命令来生成configure。代码如下:

$cd (软件名)-(版本号)

$autoconf

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值