Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Error when installing php 5,6 #13

Closed
luisdiaswiz opened this issue Nov 22, 2019 · 12 comments
Closed

Error when installing php 5,6 #13

luisdiaswiz opened this issue Nov 22, 2019 · 12 comments

Comments

@luisdiaswiz
Copy link

Hello,

I am having an issue when installing php 5.6 with homebrew:

Last 15 lines from /Users/luisdias/Library/Logs/Homebrew/php@5.6/03.make:
typedef struct rsa_st RSA;
^
/private/tmp/php@5.6-20191122-43852-14kluu2/php-5.6.40/ext/openssl/openssl.c:3619:6: error: incomplete definition of type 'struct rsa_st'
OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, d);
^ ~~~
/private/tmp/php@5.6-20191122-43852-14kluu2/php-5.6.40/ext/openssl/openssl.c:3548:9: note: expanded from macro 'OPENSSL_PKEY_SET_BN'
_type->_name = BN_bin2bn(
~~~~~^
/usr/local/opt/openssl@1.1/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st'
typedef struct rsa_st RSA;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [ext/openssl/openssl.lo] Error 1
make: *** Waiting for unfinished jobs....

Can you please provide some help?

OS: High Sierra
Brew version:
Homebrew 2.1.16
Homebrew/homebrew-core (git revision feec; last commit 2019-11-22)

Thanks in advance

Luis Dias

@pix0r
Copy link

pix0r commented Nov 22, 2019

I just migrated my files to a new macOS machine, which is already running macOS 10.15 Catalina (previously I was on 10.14 Mojave). After running brew update && brew upgrade on the new system I have no OpenSSL 1.0.x available.

dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
  Referenced from: /usr/local/Cellar/php@5.6/5.6.40/bin/php
  Reason: image not found
Abort trap: 6

I haven't found a way to install the 1.0.x version of OpenSSL that PHP 5.6 requires, and compiling from source results in the same errors you're seeing.

This is the same underlying issue as #9 but I don't see a way to work around it if your system does not have OpenSSL 1.0.x available. My next step will be to try compiling OpenSSL 1.0.2t from source: https://www.openssl.org/source/ and then recompiling this php@5.6 pointing at that version.

@pix0r
Copy link

pix0r commented Nov 22, 2019

Just noticed that the OpenSSL (1.0.x) formula was recently removed from homebrew-core: Homebrew/homebrew-core#46876

@luisdiaswiz
Copy link
Author

Hi,

Thank you for the reply.

Do you think you'll be able to fix the issue?

Regards,

Luis Dias

@ghost
Copy link

ghost commented Nov 29, 2019

Similar Issue on
OS: High Sierra

Last 15 lines from /Users/apple/Library/Logs/Homebrew/php@5.6/03.make: typedef struct rsa_st RSA; ^ /private/tmp/php@5.6-20191129-21483-2dg4kv/php-5.6.40/ext/openssl/openssl.c:3619:6: error: incomplete definition of type 'struct rsa_st' OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, d); ^ ~~~ /private/tmp/php@5.6-20191129-21483-2dg4kv/php-5.6.40/ext/openssl/openssl.c:3548:9: note: expanded from macro 'OPENSSL_PKEY_SET_BN' _type->_name = BN_bin2bn( \ ~~~~~^ /usr/local/opt/openssl@1.1/include/openssl/ossl_typ.h:110:16: note: forward declaration of 'struct rsa_st' typedef struct rsa_st RSA; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make: *** [ext/openssl/openssl.lo] Error 1 make: *** Waiting for unfinished jobs....

@Kigamba
Copy link

Kigamba commented Dec 17, 2019

Any solution to this issue?

@pgrenaud
Copy link
Contributor

We won't be able to provide support to older macOS version (other than Catalina). Sorry about this.

@sgdrew
Copy link

sgdrew commented Dec 23, 2019

Figured it out... I just had to find libcrypto.1.0.0.dylib and libssl.1.0.0.dylib elsewhere on my mac and copy them over to the spots where they were missing...

==> Postinstalling php@5.6
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set php_ini /usr/local/etc/php/5.6/php.ini system
Last 15 lines from /Users/andrew.purkett/Library/Logs/Homebrew/php@5.6/post_install.01.pear:
2019-12-23 10:14:49 -0700
/usr/local/Cellar/php@5.6/5.6.40/bin/pear
config-set
php_ini
/usr/local/etc/php/5.6/php.ini
system
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
  Referenced from: /usr/local/Cellar/php@5.6/5.6.40/bin/php
  Reason: image not found
$ find / -name "libcrypto.1.0.0.dylib"
(Output omitted)
$ sudo cp /usr/local/Cellar/openssl/1.0.2r/lib/libcrypto.1.0.0.dylib /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
$ brew postinstall exolnet/deprecated/php@5.6
==> Postinstalling php@5.6
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set php_ini /usr/local/etc/php/5.6/php.ini system
Last 15 lines from /Users/andrew.purkett/Library/Logs/Homebrew/php@5.6/post_install.01.pear:
2019-12-23 10:14:49 -0700
/usr/local/Cellar/php@5.6/5.6.40/bin/pear
config-set
php_ini
/usr/local/etc/php/5.6/php.ini
system
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/Cellar/php@5.6/5.6.40/bin/php
  Reason: image not found
$ find / -name "libssl.1.0.0.dylib"
(Output omitted)
$ sudo cp /usr/local/Cellar/openssl/1.0.2r/lib/libssl.1.0.0.dylib /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
$ brew postinstall exolnet/deprecated/php@5.6
==> Postinstalling php@5.6
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set php_ini /usr/local/etc/php/5.6/php.ini system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set php_dir /usr/local/share/pear@5.6 system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set doc_dir /usr/local/share/pear@5.6/doc system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set ext_dir /usr/local/lib/php/pecl/20131226 system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set bin_dir /usr/local/opt/php@5.6/bin system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set data_dir /usr/local/share/pear@5.6/data system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set cfg_dir /usr/local/share/pear@5.6/cfg system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set www_dir /usr/local/share/pear@5.6/htdocs system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set man_dir /usr/local/share/man system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set test_dir /usr/local/share/pear@5.6/test system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear config-set php_bin /usr/local/opt/php@5.6/bin/php system
==> /usr/local/Cellar/php@5.6/5.6.40/bin/pear update-channels
$ brew link php@5.6 --force
Linking /usr/local/Cellar/php@5.6/5.6.40... 25 symlinks created

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/usr/local/opt/php@5.6/bin:$PATH"' >> ~/.bash_profile
  echo 'export PATH="/usr/local/opt/php@5.6/sbin:$PATH"' >> ~/.bash_profile
$ php -v
PHP 5.6.40 (cli) (built: Apr 23 2019 11:14:34) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

@a2dforcecode
Copy link

Thanks! But this works ONLY if you have php@5.6 in Cellar already. So better get it somewhere and keep it, alongside with these two openssl files and this manual, lol.

@tholu
Copy link

tholu commented Feb 8, 2020

See my comment here: #14 (comment)

@fundfive-personal
Copy link

Yes and thank you! If you are looking to run php5.6 and, like me, you need php7.x also, you will need to have two versions os openssl at hand. Don't bother trying to get homebrew to do that for you because it will not. Simply copy libraries to the correct path (as suggested above) and you will have it.

@amichia
Copy link

amichia commented Mar 25, 2020

Hello, I have tried almost everything to solve this. None of the above suggestions works for me.

I dont have php5.6 installed anymore and Im not able to install it with brew. Apache works fine, php7.1 also works. But php5.6 (the one I need) doesnt.

Any suggestions?

Thanks!

@arvi
Copy link

arvi commented Sep 24, 2020

@amichia I added an answer here on what worked for me: #23 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants