php5.6 install openssl extension

Note that php5.6 needs to install openssl 1.1 or lower version.

wget https://www.openssl.org/source/old/1.0.0/openssl-1.0.0.tar.gz
 
tar xzvf openssl-1.0.0.tar.gz

cd openssl-1.0.0

# 编译支持的系统查看
uname -a

./Configure LIST | grep darwin

# 默认会生成shared库(动态),如果加上no-shared,就不会生成动态库
./Configure darwin64-x86_64-cc --prefix=/usr/local/opt/openssl no-asm --openssldir=/usr/local/ssl

# 生成MakeFile
./config

./Configure darwin64-x86_64-cc

# 重新配置Makefile
./Configure darwin64-x86_64-cc --prefix=/usr/local/opt/openssl no-asm --openssldir=/usr/local/ssl

make && make install

Error when installing openssl

POD document had syntax errors at /usr/bin/pod2man line 69

Solution

mv /usr/bin/pod2man /usr/bin/pod2man.bak

PHP adds openssl extension

installation steps

# 进入PHP源码目录
cd php-5.6.24/ext/openssl

cp config0.m4 config.m4

/usr/local/php5.6/bin/phpize

./configure --enable-openssl --with-openssl-dir=/usr/local/Cellar/openssl/1.0.2r/ --with-php-config=/usr/local/php5.6/bin/php-config

./configure  --with-openssl=/usr/local/Cellar/openssl/1.0.2l/

./configure --with-php-config=/usr/local/php5.6/bin/php-config --with-openssl=/usr/local/Cellar/openssl/1.0.2r/

make && make install

php.ini file added

extension=openssl.so

Then restart PHP

Reference article

Error compiling and installing openssl, POD document had syntax errors

Compilation and installation of openssl1.0 under mac (the essence of stepping on the pit)

An error occurred when compiling and installing php-openssl on Mac OS, error: Cannot find OpenSSL's /evp.h

Guess you like

Origin blog.csdn.net/mouday/article/details/135223707