安装openss:
brew install openssl
php安装:
./configure --prefix=/usr/local/php
--with-config-file-path=/usr/local/php/etc/ --with-gd
--with-freetype-dir --enable-mysqlnd
--with-pdo-mysql=mysqlnd--with-mysqli=mysqlnd--enable-mbstring
--enable-zip --enable-fpm
--with-openssl=/usr/local/Cellar/openssl/1.0.2p --with-curl
说明:php7取消了
mcrypt,用openssl来替代相关功能,因此不要再用--with-mcrypt参数了,改为--with-openssl,mysqli
是给phpmyadmin管理工具用的。
nginx安装:
./configure --user=tangjian --group=admin
--prefix=/usr/local/nginx --with-http_stub_status_module
--with-http_ssl_module
--with-openssl=/usr/local/Cellar/openssl/1.0.2p
如果make时出现错误:
make[1]: ***
[/usr/local/Cellar/openssl/1.0.2p/.openssl/include/openssl/ssl.h]
修改[nginx安装包]/auto/lib/openssl/conf文件。
把
CORE_INCS="$CORE_INCS
$OPENSSL/.openssl/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
改成:
CORE_INCS="$CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS
$OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
保存后重新make
。