swoole-src icon indicating copy to clipboard operation
swoole-src copied to clipboard

[Question]M1芯片 Symbol not found:_OPENSSL_init_ssl

Open TheSunNanbei opened this issue 3 years ago • 1 comments

错误信息

dyld:lazy symbol binding failed:Symbol not found:_OPENSSL_init_ssl
Referenced from:php8.0.8/lib/php/extensions/no-debug-non-zts-20200930/swoole.so
Expected in:flat namespace

swoole版本

php --ri swoole
image

问题描述

我在M1芯片的机器上安装swoole后,在运行对应程序时,遇到了这个报错(2台M1均如此)。 并且我尝试使用brew install openssl安装其他的版本, 在pecl install swoole 中的openssl 也指定了--with-openssl-dir 对应地址, 但是问题仍然存在。 想请教一下,这种情况应该如何解决。thanks.

TheSunNanbei avatar Apr 20 '22 09:04 TheSunNanbei

试一下暴力解决,运行以下命令以后再从头开始编译一遍

export LIBS="$LIBS -lssl -lcrypto"
export LDFLAGS="$LDFLAGS -L$(brew --prefix openssl)/lib"
export PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig $PKG_COFNIG_PATH"
export CFLAGS="$CFLAGS $(brew --prefix openssl)/include"
export CPPFLAGS="$CPPFLAGS $(brew --prefix openssl)/include"

export OPENSSL_ROOT_DIR="$(brew --prefix openssl)"
export OPENSSL_LIBS="-L$(brew --prefix openssl)/lib"
export OPENSSL_CFLAGS="-I$(brew --prefix openssl)/include"

twose avatar Apr 21 '22 08:04 twose