mac php 7.1.7 mysql_mac编译安装php7.1

1、执行配置命令

./configure --prefix=/usr/local/php71 --with-apxs2=/usr/sbin/apxs --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-zlib --with-jpeg-dir --with-png-dir --with-libxml-dir=/usr/bin/xml2-config --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts

执行后报错,说找不到libxml2

2、下载libxml2 下载最新版

3、再次执行php编译配置报错

configure: error: libcrypto not found!,这个是OpenSSL库找不到,需要编译安装OpenSSL

4、https://github.com/openssl/openssl  下载OpenSSL

5、进入OpenSSL源码,执行./config,然后执行make && make install

安装后目录在/usr/local/openssl 6、编译php依然报错

configure: error: Cannot find OpenSSL's 头文件找不到。

7、继续报错

checking whether to enable JIS-mapped Japanese font support in GD... no

configure: error: webp/decode.h not found.

需要安装支持webp。

8、下载webp并安装

安装过程中报错

configure.ac:9: error: possibly undefined macro: AC_PROG_LIBTOOL

If this token and others are legitimate, please use m4_pattern_allow.

See the Autoconf documentation. 提示需要安装libtool

curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz

tar xzvf libtool-2.2.6b.tar.gz

cd libtool-2.2.6b

./configure --prefix=/usr/local

make

sudo make install

wget https://github.com/webmproject/libwebp/archive/master.zip 安装后相关目录

/usr/local/include/webp/decode.h

/usr/local/include/webp/encode.h

/usr/local/include/webp/types.h

/usr/local/lib/libwebp.*

/usr/local/bin/cwebp

/usr/local/bin/dwebp

编译php的时候增加参数 –with-webp-dir=/usr/local/include/webp/

9、继续提示

configure: error: jpeglib.h not found

没法。。。。。。源码安装

jpegsrc.v8d.tar.gz。mac下解压出文件夹jpeg-8d,把它放到桌面. 10、提示

configure: error: png.h not found.

下载地址https://sourceforge.net/projects/libpng/files/libpng16/1.6.28/

11、继续提示

If configure fails try --with-xpm-dir=

configure: error: freetype-config not found. 按装xpm时又报

checking for XPM... configure: error: Package requirements (xproto x11) were not met.

因此还得把xproto x11两个装上

下载安装freetype

http://download.csdn.net/download/luo849278597/9373917

12、继续配置php,终于验证通过。。。。要哭了

13、安装完成

可以参考下这篇文章

http://blog.csdn.net/tianyiii/article/details/50386497

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值