今天升级 Swoole
版本的时候,指定开启 OpenSSL
的时候报错了。以下是场景还原
安装
wget https://github.com/swoole/swoole-src/archive/v4.4.8.tar.gz
tar -xzf v4.4.8.tar.gz
cd swoole-src-4.4.8
phpize
./configure --enable-openssl --enable-sockets --enable-http2 --enable-mysqlnd
然后 make 的时候报错了
$ make
/bin/sh /Users/hedeqiang/Desktop/swoole-src-4.4.8/libtool --mode=compile g++ -I. -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -DPHP_ATOM_INC -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/include -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/main -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -I/usr/local/Cellar/php/7.3.10/include/php -I/usr/local/Cellar/php/7.3.10/include/php/main -I/usr/local/Cellar/php/7.3.10/include/php/TSRM -I/usr/local/Cellar/php/7.3.10/include/php/Zend -I/usr/local/Cellar/php/7.3.10/include/php/ext -I/usr/local/Cellar/php/7.3.10/include/php/ext/date/lib -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/include -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/thirdparty/hiredis -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /Users/hedeqiang/Desktop/swoole-src-4.4.8/php_swoole_cxx.cc -o php_swoole_cxx.lo
mkdir .libs
g++ -I. -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -DPHP_ATOM_INC -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/include -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/main -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -I/usr/local/Cellar/php/7.3.10/include/php -I/usr/local/Cellar/php/7.3.10/include/php/main -I/usr/local/Cellar/php/7.3.10/include/php/TSRM -I/usr/local/Cellar/php/7.3.10/include/php/Zend -I/usr/local/Cellar/php/7.3.10/include/php/ext -I/usr/local/Cellar/php/7.3.10/include/php/ext/date/lib -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/include -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/thirdparty/hiredis -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /Users/hedeqiang/Desktop/swoole-src-4.4.8/php_swoole_cxx.cc -fno-common -DPIC -o .libs/php_swoole_cxx.o
In file included from /Users/hedeqiang/Desktop/swoole-src-4.4.8/php_swoole_cxx.cc:1:
In file included from ./php_swoole_cxx.h:19:
./php_swoole.h:129:2: error: "Enable openssl support, require openssl library"
#error "Enable openssl support, require openssl library"
^
1 error generated.
make: *** [php_swoole_cxx.lo] Error 1
开始以为 OpenSSL 没有安装,结果发现并不是
brew install openssl
Warning: openssl 1.0.2t is already installed and up-to-date
To reinstall 1.0.2t, run `brew reinstall openssl`
最后忽然想起来制定下 OpenSSL
的路径就好了
brew
安装的 OpenSSL
默认在 /usr/local/Cellar/openss/版本号
我的是 1.0.2t
,因此路径为 /usr/local/Cellar/openssl/1.0.2t
./configure --with-openssl-dir=/usr/local/Cellar/openssl/1.0.2t --enable-sockets --enable-http2 --enable-mysqlnd
ok,果真如此,,之后就可以愉快的 make && make install
了。
只是记录下而已。权当笔记...