Mac OSX 10.12.6编译安装Tengine+PHP7.1

先发一下电脑配置,电脑版本如下图:
Mac OSX 10.12.6编译安装Tengine+PHP7.1

PHP安装步骤如下:

  1. 请确保电脑已经关闭SIP(System Integrity Protection)。
    Mac OSX 10.12.6编译安装Tengine+PHP7.1

    关闭SIP的方法去问Google!

  2. 下载PHP7.1.1并且解压。

    wget http://mirrors.sohu.com/php/php-7.1.1.tar.gz
    tar -zcvf php-7.1.1.tar.gz
  3. 安装PHP前前依赖安装

brew install gcc
     brew install libxml2
     brew install openssl
     brew install autoconf
     brew install libjpeg
     brew install libpng
     brew install freetype
     brew install gettext
     brew install mcrypt libmcrypt

4.编译安装

参数如下:

./configure --prefix=/usr/local/php71 --with-config-file-path=/usr/local/php71/etc --with-mcrypt=/usr/include --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg-dir --with-freetype-dir --enable-opcache --with-libxml-dir=/usr/local/Cellar/libxml2/2.9.7 --with-openssl-dir=/usr/local/Cellar/openssl/1.0.2m/
sudo make && sudo make install

安装Tengine(nginx)步骤如下:

  1. 和PHP一样先下载Tengine! http:tengine.taobao.otg

  2. 下载依赖包:jemalloc ,zlib,openssl,pcre.

3.编译安装
参数:./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module \\n--with-pcre=/Users/guoyexuan/Downloads/pcre-8.38 \\n--with-zlib=/Users/guoyexuan/Downloads/zlib-1.2.11 \\n--with-jemalloc=/Users/guoyexuan/Downloads/jemalloc-3.6.0 \\n--with-openssl=/Users/guoyexuan/Downloads/openssl-1.0.2m
4.修改MakeFiles.

&& ./config --prefix=/Users/xxx/Downloads/tengine-2.2.1/../openssl-1.0.2m/.openssl no-shared  \
将 config 修改为 Configure darwin64-x86_64-cc, --prefix 之后的不用修改, 
修改后的如:
&& ./Configure darwin64-x86_64-cc --prefix=/Users/xxx/Downloads/tengine-2.2.1/../openssl-1.0.2m/.openssl no-shared  \

5.sudo make && sudo make install.

相关推荐