MAC下编译PHP5.5.7问题:configure: error: freetype.h not found.

执行configura时提示
configure: error: freetype.h not found.
freetype明明是使用brew安装了的。也可以查询到这个文件
stk-tianwen:freetype2 hufeiyan$ ls /usr/local/include/freetype2/freetype.h
/usr/local/include/freetype2/freetype.h
stk-tianwen:freetype2 hufeiyan$
搞了半天都通不过。
后来想到搜了一下配置文件
stk-tianwen:php-5.5.7 hufeiyan$ cat configure |grep freetype.h
      if test -f "$i/include/freetype2/freetype/freetype.h"; then
      as_fn_error $? "freetype.h not found." "$LINENO" 5
      if test -f "$i/include/freetype2/freetype/freetype.h"; then
      as_fn_error $? "freetype.h not found." "$LINENO" 5
stk-tianwen:php-5.5.7 hufeiyan$
原来他们的路径处理不同,brew安装后头文件路径为/usr/local/include/freetype2/,PHP需要的路径为/include/freetype2/freetype/
PHP认为还要/usr/local/include/freetype2/下面有一个freetype目录

执行命令
ln -s /usr/local/Cellar/freetype/2.5.2/include/freetype2/ /usr/local/Cellar/freetype/2.5.2/include/freetype2/freetype
创建一个链接后,配置通过。

最终配置成功的命令:
./configure  --with-apxs2=/usr/local/apache2/bin/apxs  --with-freetype-dir=/usr/local/opt/freetype --with-libxml-dir=/usr/local/opt/libxml2/  --with-png-dir=/usr/local/opt/libpng/  --with-jpeg-dir=/usr/local/opt/jpeg --with-gd=/usr/local/  --with-zlib-dir=/usr/local/zlib/  --with-mcrypt=/usr/local/opt/mcrypt/  --with-mysql=/usr/local/mysql  --enable-soap  --enable-mbstring=all  --enable-pdo  --with-pdo-mysql=/usr/local/mysql --with-pgsql=/Applications/Postgres93.app/Contents/MacOS --enable-opcache=no
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值