php7.28 编译出错 一直通不过去

2018-08-02 23:07:02 +08:00
 update

centos 6.4

Linux vagrant.lnmp 3.10.105-1.el6.elrepo.x86_64 #1 SMP Fri Feb 10 10:48:08 EST 2017 x86_64 x86_64 x86_64 GNU/Linux

要编译的 php 版本 7.2.8

openssl version -a

OpenSSL 1.1.0e  16 Feb 2017
built on: reproducible build, date unspecified
platform: linux-x86_64
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib64/engines-1.1\""  -Wa,--noexecstack
OPENSSLDIR: "/usr/local/ssl"
ENGINESDIR: "/usr/local/lib64/engines-1.1"
yum 装的 dev 包
openssl-devel-1.0.1e-48.el6_8.1.x86_64
出错部分:

ext/openssl/.libs/openssl.o: In function `sk_X509_pop':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_pop'
ext/openssl/.libs/openssl.o: In function `php_openssl_asn1_time_to_time_t':
/root/php-7.2.8/ext/openssl/openssl.c:940: undefined reference to `ASN1_STRING_get0_data'
/root/php-7.2.8/ext/openssl/openssl.c:955: undefined reference to `ASN1_STRING_get0_data'
/root/php-7.2.8/ext/openssl/openssl.c:955: undefined reference to `ASN1_STRING_get0_data'
ext/openssl/.libs/openssl.o: In function `zm_info_openssl':
/root/php-7.2.8/ext/openssl/openssl.c:1590: undefined reference to `OpenSSL_version'
ext/openssl/.libs/openssl.o: In function `zm_startup_openssl':
/root/php-7.2.8/ext/openssl/openssl.c:1436: undefined reference to `OPENSSL_init_ssl'
ext/openssl/.libs/openssl.o: In function `zif_openssl_decrypt':
/root/php-7.2.8/ext/openssl/openssl.c:6712: undefined reference to `EVP_CIPHER_CTX_reset'
ext/openssl/.libs/openssl.o: In function `zif_openssl_encrypt':
/root/php-7.2.8/ext/openssl/openssl.c:6625: undefined reference to `EVP_CIPHER_CTX_reset'
ext/openssl/.libs/openssl.o: In function `zif_openssl_digest':
/root/php-7.2.8/ext/openssl/openssl.c:6306: undefined reference to `EVP_MD_CTX_new'
/root/php-7.2.8/ext/openssl/openssl.c:6329: undefined reference to `EVP_MD_CTX_free'
ext/openssl/.libs/openssl.o: In function `sk_X509_num':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_X509_value':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_value'
ext/openssl/.libs/openssl.o: In function `sk_X509_CRL_num':
/usr/local/include/openssl/x509.h:226: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_X509_CRL_value':
/usr/local/include/openssl/x509.h:226: undefined reference to `OPENSSL_sk_value'
ext/openssl/.libs/openssl.o: In function `zif_openssl_dh_compute_key':
/root/php-7.2.8/ext/openssl/openssl.c:4911: undefined reference to `EVP_PKEY_get0_DH'
ext/openssl/.libs/openssl.o: In function `zif_openssl_pkey_get_details':
/root/php-7.2.8/ext/openssl/openssl.c:4823: undefined reference to `EVP_PKEY_get0_EC_KEY'
/root/php-7.2.8/ext/openssl/openssl.c:4832: undefined reference to `EVP_PKEY_get0_EC_KEY'
/root/php-7.2.8/ext/openssl/openssl.c:4750: undefined reference to `EVP_PKEY_get0_RSA'
/root/php-7.2.8/ext/openssl/openssl.c:4757: undefined reference to `RSA_get0_key'
/root/php-7.2.8/ext/openssl/openssl.c:4758: undefined reference to `RSA_get0_factors'
/root/php-7.2.8/ext/openssl/openssl.c:4759: undefined reference to `RSA_get0_crt_params'
/root/php-7.2.8/ext/openssl/openssl.c:4801: undefined reference to `EVP_PKEY_get0_DH'
/root/php-7.2.8/ext/openssl/openssl.c:4808: undefined reference to `DH_get0_pqg'
/root/php-7.2.8/ext/openssl/openssl.c:4809: undefined reference to `DH_get0_key'
/root/php-7.2.8/ext/openssl/openssl.c:4779: undefined reference to `EVP_PKEY_get0_DSA'
/root/php-7.2.8/ext/openssl/openssl.c:4786: undefined reference to `DSA_get0_pqg'
/root/php-7.2.8/ext/openssl/openssl.c:4787: undefined reference to `DSA_get0_key'
/root/php-7.2.8/ext/openssl/openssl.c:4868: undefined reference to `EVP_PKEY_get0_EC_KEY'
ext/openssl/.libs/openssl.o: In function `php_openssl_add_assoc_name_entry':
/root/php-7.2.8/ext/openssl/openssl.c:876: undefined reference to `ASN1_STRING_get0_data'
ext/openssl/.libs/openssl.o: In function `sk_X509_num':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_X509_pop':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_pop'
ext/openssl/.libs/openssl.o: In function `sk_X509_free':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_free'
ext/openssl/.libs/openssl.o: In function `zif_openssl_spki_export_challenge':
/root/php-7.2.8/ext/openssl/openssl.c:2072: undefined reference to `ASN1_STRING_get0_data'
ext/openssl/.libs/openssl.o: In function `sk_X509_new_null':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_new_null'
ext/openssl/.libs/openssl.o: In function `sk_X509_INFO_shift':
/usr/local/include/openssl/x509.h:252: undefined reference to `OPENSSL_sk_shift'
ext/openssl/.libs/openssl.o: In function `sk_X509_push':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_push'
ext/openssl/.libs/openssl.o: In function `sk_X509_INFO_num':
/usr/local/include/openssl/x509.h:252: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_X509_num':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_X509_INFO_free':
/usr/local/include/openssl/x509.h:252: undefined reference to `OPENSSL_sk_free'
ext/openssl/.libs/openssl.o: In function `sk_X509_free':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_free'
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_free'
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_free'
ext/openssl/.libs/openssl.o: In function `sk_CONF_VALUE_num':
/usr/local/include/openssl/conf.h:31: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_CONF_VALUE_value':
/usr/local/include/openssl/conf.h:31: undefined reference to `OPENSSL_sk_value'
ext/openssl/.libs/openssl.o: In function `php_openssl_pkey_init_dsa':
/root/php-7.2.8/ext/openssl/openssl.c:4169: undefined reference to `DSA_set0_pqg'
/root/php-7.2.8/ext/openssl/openssl.c:4176: undefined reference to `DSA_set0_key'
ext/openssl/.libs/openssl.o: In function `php_openssl_pkey_init_and_assign_rsa':
/root/php-7.2.8/ext/openssl/openssl.c:4135: undefined reference to `RSA_set0_key'
/root/php-7.2.8/ext/openssl/openssl.c:4141: undefined reference to `RSA_set0_factors'
/root/php-7.2.8/ext/openssl/openssl.c:4148: undefined reference to `RSA_set0_crt_params'
ext/openssl/.libs/openssl.o: In function `php_openssl_pkey_init_dh':
/root/php-7.2.8/ext/openssl/openssl.c:4246: undefined reference to `DH_set0_pqg'
ext/openssl/.libs/openssl.o: In function `php_openssl_dh_pub_from_priv':
/root/php-7.2.8/ext/openssl/openssl.c:4223: undefined reference to `BN_with_flags'
ext/openssl/.libs/openssl.o: In function `php_openssl_pkey_init_dh':
/root/php-7.2.8/ext/openssl/openssl.c:4260: undefined reference to `DH_set0_key'
ext/openssl/.libs/openssl.o: In function `php_openssl_pkey_init_dsa':
/root/php-7.2.8/ext/openssl/openssl.c:4188: undefined reference to `DSA_get0_key'
/root/php-7.2.8/ext/openssl/openssl.c:4189: undefined reference to `BN_is_zero'
ext/openssl/.libs/openssl.o: In function `php_openssl_pkey_init_dh':
/root/php-7.2.8/ext/openssl/openssl.c:4253: undefined reference to `DH_set0_key'
ext/openssl/.libs/openssl.o: In function `sk_X509_value':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_value'
ext/openssl/.libs/openssl.o: In function `sk_X509_num':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_X509_free':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_free'
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_free'
ext/openssl/.libs/openssl.o: In function `php_openssl_is_private_key':
/root/php-7.2.8/ext/openssl/openssl.c:4051: undefined reference to `EVP_PKEY_get0_DSA'
/root/php-7.2.8/ext/openssl/openssl.c:4055: undefined reference to `DSA_get0_pqg'
/root/php-7.2.8/ext/openssl/openssl.c:4060: undefined reference to `DSA_get0_key'
/root/php-7.2.8/ext/openssl/openssl.c:4034: undefined reference to `EVP_PKEY_get0_RSA'
/root/php-7.2.8/ext/openssl/openssl.c:4038: undefined reference to `RSA_get0_factors'
/root/php-7.2.8/ext/openssl/openssl.c:4069: undefined reference to `EVP_PKEY_get0_DH'
/root/php-7.2.8/ext/openssl/openssl.c:4073: undefined reference to `DH_get0_pqg'
/root/php-7.2.8/ext/openssl/openssl.c:4078: undefined reference to `DH_get0_key'
/root/php-7.2.8/ext/openssl/openssl.c:4088: undefined reference to `EVP_PKEY_get0_EC_KEY'
ext/openssl/.libs/openssl.o: In function `zif_openssl_seal':
/root/php-7.2.8/ext/openssl/openssl.c:6075: undefined reference to `EVP_CIPHER_CTX_reset'
ext/openssl/.libs/openssl.o: In function `zif_openssl_verify':
/root/php-7.2.8/ext/openssl/openssl.c:5981: undefined reference to `EVP_MD_CTX_new'
/root/php-7.2.8/ext/openssl/openssl.c:5988: undefined reference to `EVP_MD_CTX_free'
ext/openssl/.libs/openssl.o: In function `zif_openssl_sign':
/root/php-7.2.8/ext/openssl/openssl.c:5914: undefined reference to `EVP_MD_CTX_new'
/root/php-7.2.8/ext/openssl/openssl.c:5929: undefined reference to `EVP_MD_CTX_free'
ext/openssl/.libs/openssl.o: In function `zif_openssl_public_decrypt':
/root/php-7.2.8/ext/openssl/openssl.c:5806: undefined reference to `EVP_PKEY_get0_RSA'
ext/openssl/.libs/openssl.o: In function `zif_openssl_public_encrypt':
/root/php-7.2.8/ext/openssl/openssl.c:5743: undefined reference to `EVP_PKEY_get0_RSA'
ext/openssl/.libs/openssl.o: In function `zif_openssl_private_decrypt':
/root/php-7.2.8/ext/openssl/openssl.c:5675: undefined reference to `EVP_PKEY_get0_RSA'
ext/openssl/.libs/openssl.o: In function `zif_openssl_private_encrypt':
/root/php-7.2.8/ext/openssl/openssl.c:5613: undefined reference to `EVP_PKEY_get0_RSA'
ext/openssl/.libs/openssl.o: In function `zif_openssl_pkey_export':
/root/php-7.2.8/ext/openssl/openssl.c:4615: undefined reference to `EVP_PKEY_get0_EC_KEY'
ext/openssl/.libs/openssl.o: In function `zif_openssl_pkey_export_to_file':
/root/php-7.2.8/ext/openssl/openssl.c:4538: undefined reference to `EVP_PKEY_get0_EC_KEY'
ext/openssl/.libs/openssl.o: In function `php_openssl_make_REQ':
/root/php-7.2.8/ext/openssl/openssl.c:3086: undefined reference to `X509_REQ_get_subject_name'
ext/openssl/.libs/openssl.o: In function `sk_CONF_VALUE_num':
/usr/local/include/openssl/conf.h:31: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_CONF_VALUE_value':
/usr/local/include/openssl/conf.h:31: undefined reference to `OPENSSL_sk_value'
ext/openssl/.libs/openssl.o: In function `sk_CONF_VALUE_num':
/usr/local/include/openssl/conf.h:31: undefined reference to `OPENSSL_sk_num'
/usr/local/include/openssl/conf.h:31: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_CONF_VALUE_value':
/usr/local/include/openssl/conf.h:31: undefined reference to `OPENSSL_sk_value'
ext/openssl/.libs/openssl.o: In function `sk_X509_pop_free':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_pop_free'
ext/openssl/.libs/openssl.o: In function `sk_X509_new_null':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_new_null'
ext/openssl/.libs/openssl.o: In function `sk_X509_push':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_push'
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_push'
ext/openssl/.libs/openssl.o: In function `sk_X509_pop_free':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_pop_free'
ext/openssl/.libs/openssl.o: In function `sk_X509_new_null':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_new_null'
ext/openssl/.libs/openssl.o: In function `sk_X509_push':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_push'
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_push'
ext/openssl/.libs/openssl.o: In function `sk_X509_pop_free':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_pop_free'
ext/openssl/.libs/openssl.o: In function `zif_openssl_x509_parse':
/root/php-7.2.8/ext/openssl/openssl.c:2337: undefined reference to `X509_get_version'
/root/php-7.2.8/ext/openssl/openssl.c:2364: undefined reference to `X509_getm_notBefore'
/root/php-7.2.8/ext/openssl/openssl.c:2365: undefined reference to `X509_getm_notAfter'
/root/php-7.2.8/ext/openssl/openssl.c:2367: undefined reference to `X509_getm_notBefore'
/root/php-7.2.8/ext/openssl/openssl.c:2368: undefined reference to `X509_getm_notAfter'
/root/php-7.2.8/ext/openssl/openssl.c:2375: undefined reference to `X509_get_signature_nid'
ext/openssl/.libs/openssl.o: In function `sk_GENERAL_NAME_pop_free':
/usr/local/include/openssl/x509v3.h:165: undefined reference to `OPENSSL_sk_pop_free'
ext/openssl/.libs/openssl.o: In function `sk_GENERAL_NAME_num':
/usr/local/include/openssl/x509v3.h:165: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/openssl.o: In function `sk_GENERAL_NAME_value':
/usr/local/include/openssl/x509v3.h:165: undefined reference to `OPENSSL_sk_value'
ext/openssl/.libs/openssl.o: In function `openssl_x509v3_subjectAltName':
/root/php-7.2.8/ext/openssl/openssl.c:2267: undefined reference to `ASN1_STRING_get0_data'
ext/openssl/.libs/openssl.o: In function `zif_openssl_csr_sign':
/root/php-7.2.8/ext/openssl/openssl.c:3449: undefined reference to `X509_REQ_get_subject_name'
/root/php-7.2.8/ext/openssl/openssl.c:3458: undefined reference to `X509_getm_notBefore'
/root/php-7.2.8/ext/openssl/openssl.c:3459: undefined reference to `X509_getm_notAfter'
ext/openssl/.libs/openssl.o: In function `zif_openssl_csr_get_subject':
/root/php-7.2.8/ext/openssl/openssl.c:3618: undefined reference to `X509_REQ_get_subject_name'
ext/openssl/.libs/openssl.o: In function `sk_X509_free':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_free'
ext/openssl/.libs/xp_ssl.o: In function `sk_X509_num':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/xp_ssl.o: In function `sk_X509_value':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_value'
ext/openssl/.libs/xp_ssl.o: In function `sk_X509_num':
/usr/local/include/openssl/x509.h:97: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/xp_ssl.o: In function `php_openssl_create_sni_server_ctx':
/root/php-7.2.8/ext/openssl/xp_ssl.c:1321: undefined reference to `TLS_server_method'
ext/openssl/.libs/xp_ssl.o: In function `php_openssl_set_server_specific_opts':
/root/php-7.2.8/ext/openssl/xp_ssl.c:1252: undefined reference to `SSL_CTX_get_options'
/root/php-7.2.8/ext/openssl/xp_ssl.c:1279: undefined reference to `SSL_CTX_set_options'
ext/openssl/.libs/xp_ssl.o: In function `php_openssl_setup_crypto':
/root/php-7.2.8/ext/openssl/xp_ssl.c:1571: undefined reference to `TLS_client_method'
/root/php-7.2.8/ext/openssl/xp_ssl.c:1625: undefined reference to `SSL_CTX_set_security_level'
/root/php-7.2.8/ext/openssl/xp_ssl.c:1651: undefined reference to `SSL_CTX_set_alpn_select_cb'
/root/php-7.2.8/ext/openssl/xp_ssl.c:1666: undefined reference to `SSL_CTX_set_options'
/root/php-7.2.8/ext/openssl/xp_ssl.c:1571: undefined reference to `TLS_server_method'
/root/php-7.2.8/ext/openssl/xp_ssl.c:1647: undefined reference to `SSL_CTX_set_alpn_protos'
ext/openssl/.libs/xp_ssl.o: In function `php_openssl_sockop_set_option':
/root/php-7.2.8/ext/openssl/xp_ssl.c:2365: undefined reference to `SSL_get0_alpn_selected'
ext/openssl/.libs/xp_ssl.o: In function `sk_GENERAL_NAME_num':
/usr/local/include/openssl/x509v3.h:165: undefined reference to `OPENSSL_sk_num'
ext/openssl/.libs/xp_ssl.o: In function `sk_GENERAL_NAME_value':
/usr/local/include/openssl/x509v3.h:165: undefined reference to `OPENSSL_sk_value'
ext/phar/.libs/util.o: In function `phar_create_signature':
/root/php-7.2.8/ext/phar/util.c:1860: undefined reference to `EVP_MD_CTX_new'
/root/php-7.2.8/ext/phar/util.c:1892: undefined reference to `EVP_MD_CTX_free'
ext/phar/.libs/util.o: In function `phar_verify_signature':
/root/php-7.2.8/ext/phar/util.c:1563: undefined reference to `EVP_MD_CTX_new'
/root/php-7.2.8/ext/phar/util.c:1595: undefined reference to `EVP_MD_CTX_free'
/root/php-7.2.8/ext/phar/util.c:1586: undefined reference to `EVP_MD_CTX_free'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
5620 次点击
所在节点    PHP
23 条回复
components
2018-08-03 15:17:49 +08:00
mafeifan
2018-08-03 16:01:50 +08:00
https://www.jianshu.com/p/0dedba35e922 我刚写的教程 只要找到好用的镜像就行 没有几行命令就能搭建好开发环境
hheedat
2018-08-03 19:17:11 +08:00
上面有一种视觉错觉

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/476429

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX