mac pecl安装swoole失败:fatal error: 'openssl/ssl.h' file not found
mac下使用brew安装arm版php7.2,pecl命令安装swoole
命令:pecl install swoole
发生如下报错
/private/tmp/pear/temp/swoole/ext-src/php_swoole_private.h:84:2: error: "Enable openssl support, require openssl library"
#error "Enable openssl support, require openssl library"
^
In file included from /private/tmp/pear/temp/swoole/ext-src/php_swoole.cc:16:
In file included from /private/tmp/pear/temp/swoole/ext-src/php_swoole_cxx.h:20:
In file included from /private/tmp/pear/temp/swoole/ext-src/php_swoole_coroutine.h:22:
In file included from /private/tmp/pear/temp/swoole/include/swoole_coroutine.h:22:
In file included from /private/tmp/pear/temp/swoole/include/swoole_socket.h:33:
/private/tmp/pear/temp/swoole/include/swoole_ssl.h:27:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^~~~~~~~~~~~~~~
2 errors generated.
make: *** [ext-src/php_swoole.lo] Error 1
ERROR: `make' failed
openssl本机已安装,所以只需要提示是否启用openssl指定路径即可(以下路径为brew安装openssl路径)
➜ ~ pecl install swoole
...
enable sockets supports? [no] : yes
enable openssl support? [no] : yes --with-openssl-dir=/opt/homebrew/opt/openssl
...