3089

mac编译安装php7.1.3

乐果   发表于   2017 年 05 月 06 日 标签:PHP

###1、依赖包准备###

可能会出现各种依赖库问题,需要用brew来安装,因此先按照好brew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

如下:

==>This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==>Downloading and installing Homebrew...
remote: Counting objects: 3693, done.
remote: Compressing objects: 100% (3525/3525), done.
remote: Total 3693 (delta 38), reused 527 (delta 27), pack-reused 0
Receiving objects: 100% (3693/3693), 3.04 MiB | 79.00 KiB/s, done.
Resolving deltas: 100% (38/38), done.
From https://github.com/Homebrew/homebrew
 * [new branch]      master     -> origin/master
HEAD is now at 9c41fb8 update man page
==>Installation successful!
==> Next steps
Run `brew help` to get started

###2、编译安装###

./configure \
--prefix=/data/service/php71 \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-config-file-path=/data/service/php71/etc \
--with-zlib \
--with-curl \
--with-curlwrappers \
--with-mcrypt \
--with-gd \
--with-openssl \
--with-mhash \
--with-xmlrpc \
--with-jpeg-dir \
--with-png-dir \
--with-xpm-dir \
--with-freetype-dir \
--with-zlib-dir \
--enable-shared \
--enable-fpm \
--enable-xml \
--disable-rpath \
--enable-safe-mode \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--enable-mbregex \
--enable-mbstring \
--enable-gd-native-ttf \
--enable-pcntl \
--enable-sockets \
--enable-zip \
--enable-soap 

可能会出现libcurl找不到的提示,可能是缺少依赖包,去安装它:

brew install curl

Error: Another active Homebrew update process is already in progress.
Please wait for it to finish or terminate it to continue.
==> Downloading https://homebrew.bintray.com/bottles/curl-7.54.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring curl-7.54.0.sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/curl/lib
    CPPFLAGS: -I/usr/local/opt/curl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig

==> Summary
/usr/local/Cellar/curl/7.54.0: 392 files, 2.8MB

然后将上面编译配置修改下:

    --with-curl \
    //改成
    --with-curl=/usr/local/opt/curl \

其他缺少的依赖包/库照brew这个方法,安装。

乐果   发表于   2017 年 05 月 06 日 标签:PHP

0

文章评论