PHP5.6.27 Install error: error: dereferencing pointer to incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}

Php5.6.27 make && Make install reports an error and cannot be resolved. The error contents are as follows:

/usr/develop/php-5.6.27/ext/openssl/openssl.c:3485:14: error: dereferencing pointer to incomplete type 'EVP_PKEY' {aka 'struct evp_pkey_st'}
  switch (pkey->type) {
              ^~
/usr/develop/php-5.6.27/ext/openssl/openssl.c: In function 'php_openssl_pkey_init_dsa':
/usr/develop/php-5.6.27/ext/openssl/openssl.c:3557:10: error: dereferencing pointer to incomplete type 'DSA' {aka 'struct dsa_st'}
  if (!dsa->p || !dsa->q || !dsa->g) {
          ^~
/usr/develop/php-5.6.27/ext/openssl/openssl.c: In function 'php_openssl_pkey_init_dh':
/usr/develop/php-5.6.27/ext/openssl/openssl.c:3580:9: error: dereferencing pointer to incomplete type 'DH' {aka 'struct dh_st'}

Reason: php5.6.27 and OpenSSL 1.1.1c are incompatible.

I checked my OpenSSL version:

[root@node3 php-5.6.27]# openssl version
OpenSSL 1.1.1c FIPS  28 May 2019

Preliminary solution: downgrade the version of OpenSSL. I chose openssl-1.0.0c. Recompile the installation and there will be no compilation errors.

yum remove -y openssl
cd /usr/apps/
wget -c ftp://ftp.openssl.org/source/openssl-1.0.0c.tar.gz
tar -zxf openssl-1.0.0c.tar.gz
cd openssl-1.0.0c/
./config  --prefix=/usr/local --openssldir=/usr/local/ssl
make && make install
./config shared --prefix=/usr/local --openssldir=/usr/local/ssl
make clean 
make && make install
openssl version # check the version

It’s useless to find. There are always all kinds of problems

Final solution: install php7.3.13

Similar Posts: