0

我正在编译 php-7.3.22

'./configure' \
'--prefix=/usr/local/php7' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-config-file-path=/usr/local/php7/conf' \
'--with-curl=/usr' \
'--with-openssl=/usr/local/ssl' \
'--with-openssl-dir=/usr/local/ssl'

我在配置过程中收到以下错误:

checking for pkg-config... /bin/pkg-config
checking for OpenSSL version... >= 1.0.1
checking for CRYPTO_free in -lcrypto... no
configure: error: libcrypto not found!

以下是操作系统信息:

**$ uname -a**
Linux internal 4.18.0-193.19.1.el8_2.x86_64 #1 SMP Wed Aug 26 15:29:02 EDT 2020 x86_6                           4 x86_64 x86_64 GNU/Linux

**$ cat /etc/redhat-release**
Red Hat Enterprise Linux release 8.2 (Ootpa)

我已经安装了 openss-1.1.1h

sudo ./config --prefix=/usr/local/ss/ --openssldir=/usr/local/ssl shared
sudo make
sudo make test
sudo make install

OpenSSL 已安装并报告其正确版本:

$ /usr/local/ssl/bin/openssl version
OpenSSL 1.1.1h  22 Sep 2020 (Library: OpenSSL 1.1.1c FIPS  28 May 2019)

lib 文件夹显示 libcrypto 在那里。

$ ls -al /usr/local/ssl/lib/
total 10464
drwxr-xr-x.  4 root root     159 Sep 24 15:20 .
drwxr-xr-x. 10 root root     201 Sep 24 15:20 ..
drwxr-xr-x.  2 root root      55 Sep 24 15:20 engines-1.1
-rw-r--r--.  1 root root 5635122 Sep 24 15:20 libcrypto.a
lrwxrwxrwx.  1 root root      16 Sep 24 15:20 libcrypto.so -> libcrypto.so.1.1
-rwxr-xr-x.  1 root root 3359896 Sep 24 15:20 libcrypto.so.1.1
-rw-r--r--.  1 root root 1027768 Sep 24 15:20 libssl.a
lrwxrwxrwx.  1 root root      13 Sep 24 15:20 libssl.so -> libssl.so.1.1
-rwxr-xr-x.  1 root root  686168 Sep 24 15:20 libssl.so.1.1
drwxr-xr-x.  2 root root      61 Sep 24 01:46 pkgconfig

libcrypto 文件都在那里。

$ sudo find /  -name "libcrypto*so*"
/usr/lib64/libcrypto.so.1.1
/usr/lib64/libcrypto.so.1.1.1c
/usr/lib64/libcrypto.so
/usr/local/src/openssl-1.1.1h/libcrypto.so.1.1
/usr/local/src/openssl-1.1.1h/libcrypto.so
/usr/local/ssl/lib/libcrypto.so.1.1
/usr/local/ssl/lib/libcrypto.so

操作系统也安装了供应商提供的 OpenSSL

$ rpm -qa | grep openssl
openssl-devel-1.1.1c-15.el8.x86_64
openssl-1.1.1c-15.el8.x86_64
openssl-libs-1.1.1c-15.el8.x86_64
openssl-pkcs11-0.4.10-2.el8.x86_64

以下信息来自 config.log

| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char CRYPTO_free ();
| int
| main ()
| {
| return CRYPTO_free ();
|   ;
|   return 0;
| }
configure:19188: result: no
configure:19226: error: libcrypto not found!

## ---------------- ##

我错过了什么?

4

1 回答 1

0

尝试这个

./configure LDFLAGS="-L/usr/lib64/ -lcrypto"
于 2020-09-24T21:45:18.617 回答