OLS PHP 5.6 wont compile with openssl.

#1
Hello,

I am trying to compile ols php5.6 with openssl on centos 8 but it is not working this is the error i get:

Bash:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘add_assoc_name_entry’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:664:4: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
    to_add = ASN1_STRING_data(str);
    ^~~~~~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/asn1.h:554:1: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘asn1_time_to_time_t’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:717:2: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
  if (ASN1_STRING_length(timestr) != strlen((const char*)ASN1_STRING_data(timestr))) {
  ^~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/asn1.h:554:1: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:732:2: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
  strbuf = estrdup((char *)ASN1_STRING_data(timestr));
  ^~~~~~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/asn1.h:554:1: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘php_openssl_get_evp_md_from_algo’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:1057:24: warning: implicit declaration of function ‘EVP_dss1’; did you mean ‘EVP_sm3’? [-Wimplicit-function-declaration]
    mdtype = (EVP_MD *) EVP_dss1();
                        ^~~~~~~~
                        EVP_sm3
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:1057:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    mdtype = (EVP_MD *) EVP_dss1();
             ^
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_spki_export_challenge’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:1726:2: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
  RETVAL_STRING((char *) ASN1_STRING_data(spki->spkac->challenge), 1);
  ^~~~~~~~~~~~~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/asn1.h:554:1: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘openssl_x509v3_subjectAltName’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:1904:15: error: dereferencing pointer to incomplete type ‘X509_EXTENSION’ {aka ‘struct X509_extension_st’}
  p = extension->value->data;
               ^~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:1925:6: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
      BIO_write(bio, ASN1_STRING_data(as),
      ^~~~~~~~~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/asn1.h:554:1: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:1931:6: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
      BIO_write(bio, ASN1_STRING_data(as),
      ^~~~~~~~~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/asn1.h:554:1: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:1937:6: warning: ‘ASN1_STRING_data’ is deprecated [-Wdeprecated-declarations]
      BIO_write(bio, ASN1_STRING_data(as),
      ^~~~~~~~~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/asn1.h:554:1: note: declared here
 DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_x509_parse’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:1982:10: error: dereferencing pointer to incomplete type ‘X509’ {aka ‘struct x509_st’}
  if (cert->name) {
          ^~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘php_openssl_generate_private_key’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:3420:5: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
     if (EVP_PKEY_assign_RSA(req->priv_key, RSA_generate_key(req->priv_key_bits, 0x10001, NULL, NULL))) {
     ^~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/rsa.h:234:1: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:3428:6: warning: ‘DSA_generate_parameters’ is deprecated [-Wdeprecated-declarations]
      DSA *dsapar = DSA_generate_parameters(req->priv_key_bits, NULL, 0, NULL, NULL, NULL, NULL);
      ^~~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/dsa.h:118:1: note: declared here
 DEPRECATEDIN_0_9_8(DSA *DSA_generate_parameters(int bits,
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:3446:6: warning: ‘DH_generate_parameters’ is deprecated [-Wdeprecated-declarations]
      DH *dhpar = DH_generate_parameters(req->priv_key_bits, 2, NULL, NULL);
      ^~
In file included from /usr/include/openssl/opensslconf.h:42,
                 from /usr/include/openssl/evp.h:13,
                 from /usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:44:
/usr/include/openssl/dh.h:137:1: note: declared here
 DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator,
 ^~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘php_openssl_is_private_key’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:3485:14: error: dereferencing pointer to incomplete type ‘EVP_PKEY’ {aka ‘struct evp_pkey_st’}
  switch (pkey->type) {
              ^~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘php_openssl_pkey_init_dsa’:
/usr/local/lsws/phpbuild/php-5.6.40/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/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘php_openssl_pkey_init_dh’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:3580:9: error: dereferencing pointer to incomplete type ‘DH’ {aka ‘struct dh_st’}
  if (!dh->p || !dh->g) {
         ^~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_pkey_new’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:3548:9: error: dereferencing pointer to incomplete type ‘RSA’ {aka ‘struct rsa_st’}
    _type->_name = BN_bin2bn(         \
         ^~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:3617:6: note: in expansion of macro ‘OPENSSL_PKEY_SET_BN’
      OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, n);
      ^~~~~~~~~~~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_sign’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:4801:13: error: storage size of ‘md_ctx’ isn’t known
  EVP_MD_CTX md_ctx;
             ^~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:4845:2: warning: implicit declaration of function ‘EVP_MD_CTX_cleanup’; did you mean ‘EVP_MD_CTX_create’? [-Wimplicit-function-declaration]
  EVP_MD_CTX_cleanup(&md_ctx);
  ^~~~~~~~~~~~~~~~~~
  EVP_MD_CTX_create
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_verify’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:4859:17: error: storage size of ‘md_ctx’ isn’t known
  EVP_MD_CTX     md_ctx;
                 ^~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_seal’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:4920:17: error: storage size of ‘ctx’ isn’t known
  EVP_CIPHER_CTX ctx;
                 ^~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_open’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:5048:17: error: storage size of ‘ctx’ isn’t known
  EVP_CIPHER_CTX ctx;
                 ^~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_digest’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:5154:13: error: storage size of ‘md_ctx’ isn’t known
  EVP_MD_CTX md_ctx;
             ^~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_encrypt’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:5233:17: error: storage size of ‘cipher_ctx’ isn’t known
  EVP_CIPHER_CTX cipher_ctx;
                 ^~~~~~~~~~
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c: In function ‘zif_openssl_decrypt’:
/usr/local/lsws/phpbuild/php-5.6.40/ext/openssl/openssl.c:5316:17: error: storage size of ‘cipher_ctx’ isn’t known
  EVP_CIPHER_CTX cipher_ctx;
                 ^~~~~~~~~~
make: *** [Makefile:550: ext/openssl/openssl.lo] Error 1
**ERROR** Could not compile PHP
Does this have to do with the openssl version and if yes how to downgrade it to make it work for all ols php versions.

Regards!
 

Pong

Administrator
#2
normally you should not compile php anymore, just use lsphpphp from repository.

If you still want to compile yourself, make sure to check php forum for all kind of compiling errors, centos8 may not support php56.

I would recommend your choose CyberPanel since it will install necessary phps for you.
 
Top