./configure –enable-openssl –enable-http2 –enable-sockets –enable-async-redis –enable-mysqlnd –with-openssl-dir=/usr/local/openssl –with-php-config=/usr/local/phpstudy/soft/php/php-7.2.21/bin/php-config
下面是报错信息
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(bn_exp2.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(bn_gf2m.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(ec_print.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(rsa_saos.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(rsa_pss.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(dsa_gen.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(dh_gen.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(dso_dlfcn.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(eng_fat.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(eng_cnf.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(evp_cnf.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(a_set.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(a_mbstr.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(a_bool.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(bio_ndef.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(asn_mime.o): relocation R_X86_64_32 against `.text’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(asn_moid.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(e_gost_err.o): relocation R_X86_64_32 against `.data’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(gost2001_keyx.o): relocation R_X86_64_32 against symbol `GostR3411_94_CryptoProParamSet’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(gost2001.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(gost89.o): relocation R_X86_64_32 against symbol `GostR3411_94_TestParamSet’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(gost94_keyx.o): relocation R_X86_64_32 against symbol `GostR3411_94_CryptoProParamSet’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(gost_ameth.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(gost_asn1.o): relocation R_X86_64_32 against symbol `GOST_KEY_TRANSPORT_it’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(gost_crypt.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(gost_ctl.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(bio_b64.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/openssl/lib/libcrypto.a(bio_asn1.o): relocation R_X86_64_32 against `.rodata.str1.1′ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: * [swoole.la] 错误 1
回答
你需要将openssl编译为动态链接库。