Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP < 8.1 is not compatible with OpenSSL 3 #9503

Closed
coder-liyang opened this issue Sep 8, 2022 · 2 comments
Closed

PHP < 8.1 is not compatible with OpenSSL 3 #9503

coder-liyang opened this issue Sep 8, 2022 · 2 comments

Comments

@coder-liyang
Copy link

Description

Error in compiling php7.4.30

./configure \
--prefix=/usr/local/php7.4 \
--enable-mbstring \
--enable-xml \
--enable-pdo \
--enable-gd \
--enable-dom \
--enable-pcntl \
--enable-fpm \
--enable-bcmath \
--enable-sockets \
--enable-fpm \
--with-openssl \
--with-zlib \
--with-libxml \
--with-pdo_mysql \
--with-curl
make
sudo make install 

This error comes from make install

In file included from /home/liyang/Downloads/php-7.4.30/main/php.h:441,
                 from /home/liyang/Downloads/php-7.4.30/ext/openssl/openssl.c:28:
/home/liyang/Downloads/php-7.4.30/ext/openssl/openssl.c: In function ‘zm_startup_openssl’:
/home/liyang/Downloads/php-7.4.30/ext/openssl/openssl.c:1520:58: error: ‘RSA_SSLV23_PADDING’ undeclared (first use in this function); did you mean ‘RSA_PKCS1_PADDING’?
 1520 |         REGISTER_LONG_CONSTANT("OPENSSL_SSLV23_PADDING", RSA_SSLV23_PADDING, CONST_CS|CONST_PERSISTENT);
      |                                                          ^~~~~~~~~~~~~~~~~~
/home/liyang/Downloads/php-7.4.30/Zend/zend_constants.h:53:105: note: in definition of macro ‘REGISTER_LONG_CONSTANT’
   53 | #define REGISTER_LONG_CONSTANT(name, lval, flags)  zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
      |                                                                                                         ^~~~
/home/liyang/Downloads/php-7.4.30/ext/openssl/openssl.c:1520:58: note: each undeclared identifier is reported only once for each function it appears in
 1520 |         REGISTER_LONG_CONSTANT("OPENSSL_SSLV23_PADDING", RSA_SSLV23_PADDING, CONST_CS|CONST_PERSISTENT);
      |                                                          ^~~~~~~~~~~~~~~~~~
.
.
.
.
.
.
.
In file included from /home/liyang/Downloads/php-7.4.30/ext/openssl/openssl.c:46:
/usr/include/openssl/rsa.h:288:5: note: declared here
  288 | int RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to,
      |     ^~~~~~~~~~~~~~~~~~
/home/liyang/Downloads/php-7.4.30/ext/openssl/openssl.c:5960:41: warning: ‘EVP_PKEY_get0_RSA’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
 5960 |                                         EVP_PKEY_get0_RSA(pkey),
      |                                         ^~~~~~~~~~~~~~~~~
In file included from /home/liyang/Downloads/php-7.4.30/ext/openssl/openssl.c:44:
/usr/include/openssl/evp.h:1346:22: note: declared here
 1346 | const struct rsa_st *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey);
      |                      ^~~~~~~~~~~~~~~~~
/home/liyang/Downloads/php-7.4.30/ext/openssl/openssl.c:5960:41: warning: passing argument 4 of ‘RSA_public_decrypt’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 5960 |                                         EVP_PKEY_get0_RSA(pkey),
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/liyang/Downloads/php-7.4.30/ext/openssl/openssl.c:46:
/usr/include/openssl/rsa.h:289:29: note: expected ‘RSA *’ {aka ‘struct rsa_st *’} but argument is of type ‘const struct rsa_st *’
  289 |                        RSA *rsa, int padding);
      |                        ~~~~~^~~
make: *** [Makefile:706: ext/openssl/openssl.lo] Error 1

PHP Version

PHP 7.4.30

Operating System

Ubuntu 22.04 LTS

@coder-liyang
Copy link
Author

openssl version
OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

@cmb69
Copy link
Contributor

cmb69 commented Sep 8, 2022

PHP 7.4 (and PHP 8.0) are not compatible with OpenSSL 3. Either use PHP 8.1, or stick with OpenSSL 1.1 with these older PHP versions.

@cmb69 cmb69 closed this as completed Sep 8, 2022
@cmb69 cmb69 changed the title Error in compiling php7.4.30 PHP < 8.1 is not compatible with OpenSSL 3 Sep 8, 2022
gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Nov 20, 2022
Only affects build time and forced rebuild in place catches installed versions

Closes: https://bugs.gentoo.org/797676
Bug: php/php-src#9503
Signed-off-by: Brian Evans <grknight@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants