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

Adds optional openssl@1.1 compatability patch for php@5.6. #25

Closed
wants to merge 1 commit into from
Closed

Adds optional openssl@1.1 compatability patch for php@5.6. #25

wants to merge 1 commit into from

Conversation

JParkinson1991
Copy link

Patch can be enabled through use of --with-openssl-1.1-patch during install/reinstall.

Formula must be installed/reinstalled from source (--build-from-source) for this option to have an affect.

$ cd /usr/local/opt/openssl/bin
$ ./openssl version
OpenSSL 1.1.1g  21 Apr 2020

$ brew install --build-from-source php@5.6 --with-openssl-1.1-patch
$ php -v
PHP 5.6.40 (cli) (built: Apr 28 2020 10:07:17)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Fixes
#14 #22 #23

Probably Fixes, untested
#17 #19

Patch can be enabled through use of `--with-openssl-1.1-patch` during
install/reinstall. Formula must be installed/reinstalled from source
for this option to have an effect.
@JParkinson1991
Copy link
Author

JParkinson1991 commented Apr 29, 2020

EDIT: @dgetson has since deleted their comment but for those interested

To install/test php@5.6 with the patch included in this pull request you must install the formula using a direct link to it's ruby file.

$ brew reinstall --build-from-source https://raw.githubusercontent.com/JParkinson1991/homebrew-deprecated/79d817a7ef794234d5276df0487a9d037b7b7bba/Formula/php%405.6.rb --with-openssl-1.1-patch

# If you get errors due to URL formatting/encoding etc try
$ brew reinstall --build-from-source https://raw.githubusercontent.com/JParkinson1991/homebrew-deprecated/79d817a7ef794234d5276df0487a9d037b7b7bba/Formula/php@5.6.rb --with-openssl-1.1-patch

02/06/2020 Updated with secondary install command

@hanoii
Copy link

hanoii commented Apr 30, 2020

Why not making it the default?

@JParkinson1991
Copy link
Author

@hanoii just a preference.

Because PHP 5.6 does not support OpenSSL 1.1 by default, i dont think this package should either. Also, i haven't tested but i dont think the patched version will compile against OpenSSL 1.0. If the patch is applied by default then (in it's default state) this package does not match the standard/expected PHP 5.6 requirements which i dont think is the right thing to do.

The solution is there, happy to discuss implementation.

@dmitriydzyuba
Copy link

Thank you for your solution @JParkinson1991
I'm just thinking that most of the installs will need to have this patch applied, but how do users will know they need to use that argument?

Is there an option for this to be applied automatically if needed or at least output a message to show user that this argument is available (if installation fails)?

@tholu
Copy link

tholu commented May 11, 2020

I successfully tested the patch, thank you @JParkinson1991 ! As new installations with OpenSSL 1.0 all are doomed to fail, applying this patch to use openssl 1.1 by default is a valid option from my POV. However I also understand the rationale to not make it default.

@JParkinson1991
Copy link
Author

@dmitriydzyuba i'm sure its possible to add compilation error messages stating the patch option is available, it may even be possible to predetermine if the patch is required at pre installation (possible over engineering here) but it would take someone with a better understanding of the ruby language to implement this. I really just 'hacked' together something that worked for adding in the patch option.

@tholu im happy to have the option work from either side, --with-openssl-1.1-patch or --without-openssl-1.1-patch who makes the call though im not too sure.

@roskoshinsky
Copy link

$ brew install --build-from-source php@5.6 --with-openssl-1.1-patch

In this case brew give me an error:

Error: invalid option: --with-openssl-1.1-patch

What is wrong with my brew?

MacOS 10.14.6
Homebrew 2.2.17
Homebrew/homebrew-core (git revision 6bee; last commit 2020-05-25)

@JParkinson1991
Copy link
Author

@roskoshinsky unless you’re using the formula from my pull requestes you wont have the —with-openssl-1.1.patch option.

My first comment explains how to use the forumal from this pull request directly.

@roskoshinsky
Copy link

@roskoshinsky unless you’re using the formula from my pull requestes you wont have the —with-openssl-1.1.patch option.

My first comment explains how to use the forumal from this pull request directly.

How can I use formula from your pull requests?

When I use

brew reinstall --build-from-source https://raw.githubusercontent.com/JParkinson1991/homebrew-deprecated/79d817a7ef794234d5276df0487a9d037b7b7bba/Formula/php%405.6.rb --with-openssl-1.1-patch

i get the same error.

@JParkinson1991
Copy link
Author

The option definitely exists in the update formula, you can source and see it for yourself.. so i have no idea why you’re getting invalid option 😕

Can only assume its a local problem with brew or you’re shell, the option definitely exists.

@jcapcik
Copy link

jcapcik commented May 28, 2020

@roskoshinsky Be sure to replace the php%405.6 with php@5.6, then it worked for me.

Thanks @JParkinson1991 for this! This was driving me nuts trying to get both php@5.6 and node to work as they are referencing different iuc4c versions.

@JParkinson1991
Copy link
Author

Thanks @jcapcik i have added extra notes to my first comment highlighting the change to the url.

@tuancode
Copy link

tuancode commented Aug 2, 2020

Hi @JParkinson1991,

I didn't see xdebug in your Formula. I tried to use Perl from your installation to install but there was no xdebug supported php 5.6 on Pecl server. It would be really nice if you can include it in your Formula.

Thanks!

@JParkinson1991
Copy link
Author

JParkinson1991 commented Aug 3, 2020

@tuancode xdebug can be installed like any other extenstion so there is no need to bundle it into the PHP formula, nor would i recommend it.

there was no xdebug supported php 5.6 on Pecl server.

My assumption is you are trying to install the latest version of xdebug?

xdebug dropped compatability for PHP 5.6 with release 2.6.0, previous version are compatabile however.

$ pecl install xdebug-2.5.5

Screenshot 2020-08-03 at 08 57 59

Hope that helps

@ryross
Copy link

ryross commented Aug 21, 2020

Thanks for posting this @JParkinson1991 I was only able to get 5.6 working from locally w/ your patch! +1 to merge

@bytehead
Copy link

Works for me too! 💪

@prdanelli
Copy link

Hey, thanks for the patch, i've been struggling with getting php5.6 working for a legacy project.

I seem to be getting make errors:

╰─$ brew reinstall --build-from-source https://raw.githubusercontent.com/JParkinson1991/homebrew-deprecated/79d817a7ef794234d5276df0487a9d037b7b7bba/Formula/    php@5.6.rb --with-openssl-1.1-patch         ↵ 1
Warning: Calling Installation of php@5.6 from a GitHub commit URL is deprecated! Use 'brew extract php@5.6' to stable tap on GitHub instead.
######################################################################## 100.0%
==> Downloading https://raw.githubusercontent.com/JParkinson1991/homebrew-deprecated/79d817a7ef794234d5276df0487a9d037b7b7bba/Formula/php@5.6.rb.
==> Downloading https://raw.githubusercontent.com/opencomputeproject/Rack-Manager/master/Contrib-Inspur/openbmc/meta-openembedded/meta-oe/recipes-devtools/php/php    /0001-PHP-5.6-LibSSL-1.1-compatibility.pat
Already downloaded: /Users/paul/Library/Caches/Homebrew/downloads/    e6c57b89b9d40dd65476e5586a0469c9a1acbc021433426b3d076f54cb2b138c--0001-PHP-5.6-LibSSL-1.1-compatibility.patch
==> Downloading https://php.net/get/php-5.6.40.tar.xz/from/this/mirror
Already downloaded: /Users/paul/Library/Caches/Homebrew/downloads/ab2ea146f7d8c5258e6d33e9522dac5528cbc3e966bc6e5689fa57860dbb5441--php-5.6.40.tar.xz
==> Reinstalling php@5.6 --with-openssl-1.1-patch
==> Patching
patching file acinclude.m4
Hunk #1 succeeded at 444 (offset 3 lines).
Hunk #2 succeeded at 459 (offset 3 lines).
Hunk #3 succeeded at 494 (offset 3 lines).
Hunk #4 succeeded at 506 (offset 3 lines).
Hunk #5 succeeded at 2500 with fuzz 2 (offset 81 lines).
patching file Zend/zend_compile.h
patching file Zend/zend_execute.h
==> Applying 0001-PHP-5.6-LibSSL-1.1-compatibility.patch
patching file ext/openssl/openssl.c
patching file ext/openssl/xp_ssl.c
patching file ext/phar/util.c
==> ./buildconf --force
==> ./configure --prefix=/usr/local/Cellar/php@5.6/5.6.40 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.6 --with-config-file-path=/usr/local/    etc/php/5.6 --with-config-file-scan-dir=/usr
==> make
Last 15 lines from /Users/paul/Library/Logs/Homebrew/php@5.6/03.make:
/bin/sh /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/libtool --silent --preserve-dup-deps --mode=compile clang  -Imain/ -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/ -DPHP_ATOM_INC -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/include -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40 -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/    ext/date/lib -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/ereg/regex -I/usr/local/Cellar/krb5/1.18.2/include -I/usr/local/opt/openssl@1.1/include     -I/usr/local/opt/sqlite/include -I/usr/local/opt/curl-openssl/include -I/usr/local/opt/jpeg/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/    include/freetype2 -I/usr/local/opt/gettext/include -I/usr/local/opt/gmp/include -I/usr/local/Cellar/icu4c/67.1/include -I/usr/local/opt/openldap/include -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/oniguruma -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl/mbfl -I/usr/local/opt/mcrypt/include -I/usr/local/opt/freetds/include -I/usr/local/opt/    libpq/include -I/usr/local/opt/aspell/include/pspell -I/usr/local/opt/tidy-html5/include -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/TSRM -I/private/    tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/Zend  -DU_USING_ICU_NAMESPACE=1 -no-cpp-precomp  -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/    include -g -O2 -fvisibility=hidden  -c /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/reentrancy.c -o main/reentrancy.lo
/bin/sh /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/libtool --silent --preserve-dup-deps --mode=compile clang  -Imain/ -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/ -DPHP_ATOM_INC -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/include -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40 -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/    ext/date/lib -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/ereg/regex -I/usr/local/Cellar/krb5/1.18.2/include -I/usr/local/opt/openssl@1.1/include     -I/usr/local/opt/sqlite/include -I/usr/local/opt/curl-openssl/include -I/usr/local/opt/jpeg/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/    include/freetype2 -I/usr/local/opt/gettext/include -I/usr/local/opt/gmp/include -I/usr/local/Cellar/icu4c/67.1/include -I/usr/local/opt/openldap/include -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/oniguruma -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl/mbfl -I/usr/local/opt/mcrypt/include -I/usr/local/opt/freetds/include -I/usr/local/opt/    libpq/include -I/usr/local/opt/aspell/include/pspell -I/usr/local/opt/tidy-html5/include -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/TSRM -I/private/    tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/Zend  -DU_USING_ICU_NAMESPACE=1 -no-cpp-precomp  -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/    include -g -O2 -fvisibility=hidden  -c /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/php_variables.c -o main/php_variables.lo
/bin/sh /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/libtool --silent --preserve-dup-deps --mode=compile clang  -Imain/ -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/ -DPHP_ATOM_INC -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/include -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40 -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/    ext/date/lib -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/ereg/regex -I/usr/local/Cellar/krb5/1.18.2/include -I/usr/local/opt/openssl@1.1/include     -I/usr/local/opt/sqlite/include -I/usr/local/opt/curl-openssl/include -I/usr/local/opt/jpeg/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/    include/freetype2 -I/usr/local/opt/gettext/include -I/usr/local/opt/gmp/include -I/usr/local/Cellar/icu4c/67.1/include -I/usr/local/opt/openldap/include -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/oniguruma -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl/mbfl -I/usr/local/opt/mcrypt/include -I/usr/local/opt/freetds/include -I/usr/local/opt/    libpq/include -I/usr/local/opt/aspell/include/pspell -I/usr/local/opt/tidy-html5/include -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/TSRM -I/private/    tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/Zend  -DU_USING_ICU_NAMESPACE=1 -no-cpp-precomp  -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/    include -g -O2 -fvisibility=hidden  -c /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/php_ticks.c -o main/php_ticks.lo
/bin/sh /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/libtool --silent --preserve-dup-deps --mode=compile clang  -Imain/ -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/ -DPHP_ATOM_INC -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/include -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40 -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/    ext/date/lib -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/ereg/regex -I/usr/local/Cellar/krb5/1.18.2/include -I/usr/local/opt/openssl@1.1/include     -I/usr/local/opt/sqlite/include -I/usr/local/opt/curl-openssl/include -I/usr/local/opt/jpeg/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/    include/freetype2 -I/usr/local/opt/gettext/include -I/usr/local/opt/gmp/include -I/usr/local/Cellar/icu4c/67.1/include -I/usr/local/opt/openldap/include -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/oniguruma -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl/mbfl -I/usr/local/opt/mcrypt/include -I/usr/local/opt/freetds/include -I/usr/local/opt/    libpq/include -I/usr/local/opt/aspell/include/pspell -I/usr/local/opt/tidy-html5/include -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/TSRM -I/private/    tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/Zend  -DU_USING_ICU_NAMESPACE=1 -no-cpp-precomp  -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/    include -g -O2 -fvisibility=hidden  -c /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/network.c -o main/network.lo
/bin/sh /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/libtool --silent --preserve-dup-deps --mode=compile clang  -Imain/ -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/ -DPHP_ATOM_INC -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/include -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40 -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/    ext/date/lib -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/ereg/regex -I/usr/local/Cellar/krb5/1.18.2/include -I/usr/local/opt/openssl@1.1/include     -I/usr/local/opt/sqlite/include -I/usr/local/opt/curl-openssl/include -I/usr/local/opt/jpeg/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/    include/freetype2 -I/usr/local/opt/gettext/include -I/usr/local/opt/gmp/include -I/usr/local/Cellar/icu4c/67.1/include -I/usr/local/opt/openldap/include -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/oniguruma -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl/mbfl -I/usr/local/opt/mcrypt/include -I/usr/local/opt/freetds/include -I/usr/local/opt/    libpq/include -I/usr/local/opt/aspell/include/pspell -I/usr/local/opt/tidy-html5/include -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/TSRM -I/private/    tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/Zend  -DU_USING_ICU_NAMESPACE=1 -no-cpp-precomp  -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/    include -g -O2 -fvisibility=hidden  -c /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/php_open_temporary_file.c -o main/php_open_temporary_file.lo
/bin/sh /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/libtool --silent --preserve-dup-deps --mode=compile clang  -Imain/ -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/ -DPHP_ATOM_INC -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/include -I/private/tmp/    php@5.6-20200825-85544-1rtlncu/php-5.6.40/main -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40 -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/    ext/date/lib -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/ereg/regex -I/usr/local/Cellar/krb5/1.18.2/include -I/usr/local/opt/openssl@1.1/include     -I/usr/local/opt/sqlite/include -I/usr/local/opt/curl-openssl/include -I/usr/local/opt/jpeg/include -I/usr/local/opt/libpng/include -I/usr/local/opt/freetype/    include/freetype2 -I/usr/local/opt/gettext/include -I/usr/local/opt/gmp/include -I/usr/local/Cellar/icu4c/67.1/include -I/usr/local/opt/openldap/include -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/oniguruma -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl -I/    private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/ext/mbstring/libmbfl/mbfl -I/usr/local/opt/mcrypt/include -I/usr/local/opt/freetds/include -I/usr/local/opt/    libpq/include -I/usr/local/opt/aspell/include/pspell -I/usr/local/opt/tidy-html5/include -I/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/TSRM -I/private/    tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/Zend  -DU_USING_ICU_NAMESPACE=1 -no-cpp-precomp  -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/    include -g -O2 -fvisibility=hidden  -c /private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/output.c -o main/output.lo
/private/tmp/php@5.6-20200825-85544-1rtlncu/php-5.6.40/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2
        readdir_r(dirp, entry);
        ~~~~~~~~~            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here
int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);
^
1 error generated.
make: *** [main/reentrancy.lo] Error 1
make: *** Waiting for unfinished jobs....

Do not report this issue to Homebrew/brew or Homebrew/core!

Traceback (most recent call last):
    22: from /usr/local/Homebrew/Library/Homebrew/build.rb:226:in `<main>'
    21: from /usr/local/Homebrew/Library/Homebrew/build.rb:137:in `install'
    20: from /usr/local/Homebrew/Library/Homebrew/utils.rb:492:in `with_env'
    19: from /usr/local/Homebrew/Library/Homebrew/build.rb:142:in `block in install'
    18: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1180:in `brew'
    17: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2149:in `stage'
    16: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `stage'
    15: from /usr/local/Homebrew/Library/Homebrew/resource.rb:82:in `stage'
    14: from /usr/local/Homebrew/Library/Homebrew/resource.rb:107:in `unpack'
    13: from /usr/local/Homebrew/Library/Homebrew/resource.rb:197:in `mktemp'
    12: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `run'
    11: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `chdir'
    10: from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `block in run'
     9: from /usr/local/Homebrew/Library/Homebrew/resource.rb:112:in `block in unpack'
     8: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2169:in `block in stage'
     7: from /usr/local/Homebrew/Library/Homebrew/utils.rb:492:in `with_env'
     6: from /usr/local/Homebrew/Library/Homebrew/formula.rb:2170:in `block (2 levels) in stage'
     5: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1187:in `block in brew'
     4: from /usr/local/Homebrew/Library/Homebrew/build.rb:174:in `block (2 levels) in install'
     3: from /Users/paul/Library/Caches/Homebrew/Formula/php@5.6.rb:180:in `install'
     2: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1963:in `system'
     1: from /usr/local/Homebrew/Library/Homebrew/formula.rb:1963:in `open'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2025:in `block in system': Failed executing: make (BuildError)
    5: from /usr/local/Homebrew/Library/Homebrew/brew.rb:148:in `<main>'
    4: from /usr/local/Homebrew/Library/Homebrew/brew.rb:160:in `rescue in <main>'
    3: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:407:in `dump'
    2: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:353:in `issues'
    1: from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:357:in `fetch_issues'
/usr/local/Homebrew/Library/Homebrew/utils/github.rb:305:in `issues_for_formula': undefined method `full_name' for nil:NilClass (NoMethodError)

I'm not sure if this is related, but:

$ openssl version
LibreSSL 2.8.3

$ brew --prefix openssl
/usr/local/opt/openssl@1.1

@abi-steve
Copy link

Just like @prwhitehead , Make is also failing for me.
/private/tmp/php@5.6-20200902-74465-b3vehr/php-5.6.40/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2 readdir_r(dirp, entry); ~~~~~~~~~ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r); ^ 1 error generated. make: *** [main/reentrancy.lo] Error 1

@tonylegrone
Copy link

Just like @prwhitehead , Make is also failing for me.
/private/tmp/php@5.6-20200902-74465-b3vehr/php-5.6.40/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2 readdir_r(dirp, entry); ~~~~~~~~~ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r); ^ 1 error generated. make: *** [main/reentrancy.lo] Error 1

I have the same issue :(

@JParkinson1991
Copy link
Author

@prwhitehead @abi-steve @tonylegrone

Im not a C developer so struggle to read those errors, but a quick google brought me to: https://bugs.php.net/bug.php?id=72889

Possible issue with clang compiler? No idea though. My version below:

$ clang --version
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@fschneider-wedge
Copy link

install from PR not working anymore for me

brew reinstall --build-from-source https://raw.githubusercontent.com/JParkinson1991/homebrew-deprecated/79d817a7ef794234d5276df0487a9d037b7b7bba/Formula/php@5.6.rb --with-openssl-1.1-patch                                                                          3.8.2
Error: Calling Installation of php@5.6 from a GitHub commit URL is disabled! Use 'brew extract php@5.6' to stable tap on GitHub instead.

@tijsverkoyen
Copy link

@fschneider-wedge I have the same error. My workaround was to apply the changes manually

brew edit php@5.6

This will open an editor, there you can make the changes listed on https://github.com/eXolnet/homebrew-deprecated/pull/25/files manually

Then you can run

brew reinstall --build-from-source php@5.6 --with-openssl-1.1-patch

With this I ran into the problem that make triggers the same error as #25 (comment)

@JParkinson1991 The output of clang --version is:

Apple clang version 12.0.0 (clang-1200.0.31.1)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@fschneider-wedge
Copy link

Thank you. In the meantime, I have successfully followed this : php@5.6 Library not loaded libicui18n.64.dylib solution.

@rlayco
Copy link

rlayco commented Sep 15, 2020

I have the same clang version with @tijsverkoyen . The reason is we have updated our Xcode and it also updates the clang version to Apple clang version 12.0.0 (clang-1200.0.31.1)

I Googled everything to revert back it to Apple clang version 11.0.3 (clang-1103.0.32.62) which previously work with @JParkinson1991 patch.

I did the following and I successfully installed legacy php@5.6

  1. Go to https://developer.apple.com/download/
  2. Search for "command line tools for Xcode 11.5" and download released date May 20, 2020
  3. Install it and when I check my clang --version it goes back to "Apple clang version 11.0.3 (clang-1103.0.32.62)"
  4. brew reinstall --build-from-source php@5.6 --with-openssl-1.1-patch
  5. And my php@5.6 was successfull installed without the CLANG error

I hope anyone who is still looking for an answer helped my solution.

UPDATE:

This is the one I'm talking about the update. Please do not update yet. It pops up again on my system update.

Screenshot 2020-09-15 at 12 16 49 PM

@JParkinson1991
Copy link
Author

JParkinson1991 commented Sep 15, 2020

Thats great @rlayco, glad you got it working.

So it definitely seems like the issue people are getting during PHP build is caused by c compiler versioning.

Annoyingly apple defines its own versions of clang, but after a bit of digging you can see that Xcode 11.5 uses llvm 9.0.0. Source: https://en.wikipedia.org/wiki/Xcode#Toolchain_versions

llvm being the toolsuite used for source compilation (i.e. when we're rebuilding PHP to include the openssl patch).

This is untested from my end, but one possible solution outside of rolling back xscope would be:

$ brew install llvm@9
# Export /usr/local/opt/llvm@9/bin into system $PATH

$ clang --version 
# Expect to see: 9

$ brew reinstall --build-from-source https://raw.githubusercontent.com/JParkinson1991/homebrew-deprecated/79d817a7ef794234d5276df0487a9d037b7b7bba/Formula/php@5.6.rb --with-openssl-1.1-patch

This wont get us around the fact homebrew has deprecated installation of formula via github links but it should hopefully get PHP building successfully when editing the formula manually.

If anyone still having issue can try manually edit and rebuild using the above steps and report back that would be great.

@tonylegrone
Copy link

@JParkinson1991 I tried that method out but, unfortunately, it looks like something in the compiler is still referencing a path in my xcode tools and causing the same error.

/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here
int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);

That's a real bummer too. Your solution is a bit easier than rolling back xcode :(

I can confirm that rolling back xcode the way @rlayco described and using the patch works though. Thanks so much to all of you who are way smarter than me :)

@tijsverkoyen
Copy link

What worked for me was, installing an older version of icu4c, by following the steps below:

Move to the correct directory inside brew.

cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula

Checkout an older version

git checkout -b icu4c-64 896d1018c7a4906f2c3fa1386aaf283497db60a2

If you don't trust this, you can find the correct commit-hash, by running git log --follow icu4c.rb, and search for the commit that changed the version to icu4c-64, which is the one needed bu PHP 5.6

After that you can reinstall icu4c

brew reinstall ./icu4c.rb

When that is done you need to apply the patch manually

brew edit php@5.6

When the editor opens, you can insert the code below around line 45. In essence this is the same as what is done in this PR, if you have already the correct formulae you can skip this.

patch do
  url "https://raw.githubusercontent.com/opencomputeproject/Rack-Manager/master/Contrib-Inspur/openbmc/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-PHP-5.6-LibSSL-1.1-compatibility.patch"
  sha256 "c9715b544ae249c0e76136dfadd9d282237233459694b9e75d0e3e094ab0c993"
end

When this is done, reinstall php@5.6

brew reinstall --build-from-source php@5.6

The drawback is your newer PHP versions will probably be broken, to resolve this you need to go back to the current version:

cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
git checkout master
brew reinstall ./icu4c.rb

@rlayco
Copy link

rlayco commented Sep 16, 2020

@tijsverkoyen yes that worked for me too at first. but the draw back for me is that yarn referenced the latest version of icu4c and I cannot do yarn commands. But as long as you don't need those for development. I think you are good.

@tonylegrone also confirmed that it worked for him.

@tijsverkoyen
Copy link

Just something a found out literally 5minutes ago, I did

cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
git checkout master
brew reinstall ./icu4c.rb

And then reinstalled php@7.3 and the php@5.6 was still working. So maybe you can do the same and check if this works for you.

@JeffSafier
Copy link

When running brew install --build-from-source php@5.6 --with-openssl-1.1-patch
I get invalid option: --with-openssl-1.1-patch

@tonylegrone
Copy link

@JeffSafier you're going to need to follow @tijsverkoyen's instructions for manually adding the patch. Then you won't need the --with-openssl-1.1-patch flag.

brew edit php@5.6

When the editor opens, you can insert the code below around line 45. In essence this is the same as what is done in this PR, if you have already the correct formulae you can skip this.

patch do
  url "https://raw.githubusercontent.com/opencomputeproject/Rack-Manager/master/Contrib-Inspur/openbmc/meta-openembedded/meta-oe/recipes-devtools/php/php/0001-PHP-5.6-LibSSL-1.1-compatibility.patch"
  sha256 "c9715b544ae249c0e76136dfadd9d282237233459694b9e75d0e3e094ab0c993"
end

When this is done, reinstall php@5.6

brew reinstall --build-from-source php@5.6

@JParkinson1991
Copy link
Author

JParkinson1991 commented Sep 16, 2020

@JeffSafier @tonylegrone i think the problem faced here invalid option: --with-openssl-1.1-patch is caused by the fact the the reinstall command did not referent the full git url to the Formula.

That said, the github direct referencing is now deprecated by homebrew so is no longer a via le solution.

I appreciate that the manual patching and switching of icu4c version etc may in some instances result in successful builds. This however is not a viable solution going forwards.

I will try put some time to this soon.

@tonylegrone
Copy link

@JParkinson1991 I agree that it's a hacky solution for now. I do want to be clear that I, myself, have not had to change my icu4c version to make it work. I'm not sure why that's giving some other people issues. I only needed to roll back xcode and patch the php formula.

@JParkinson1991
Copy link
Author

@tonylegrone dont worry about things being ‘hacky’. My original solution (#23 (comment)) that this PR was based off was just as manual.

For me, I’d be happy if we can have this condensed into a few commands with no need to manually rollback .app version etc. I need to investigate homebrew based compilation libs further at the moment they same like our best bet.

@Pypeline
Copy link

I'm still struggling to get this to work. I'm setting up a new macbook, starteds from scratch with everything up to date. I'm using the patched version of php 5.6, patched it manually using instructions in this thread. Other things I've tried:

-install older version of Xcode CLT via @rlayco comment - still not working after rebuild of php

-install older version of icu4c via @tijsverkoyen comment - still not working, but with message that "A full installation of Xcode.app is required to compile this software. Installing just the Command Line Tools is not sufficient."

-install full Xcode from app store, try again and still not working.

-install older version of llvm, no change so uninstalled.

Currently I'm getting a clang error but I don't know if it's the one others have encountered:

Last 15 lines from /Users/jarrodpyper/Library/Logs/Homebrew/php@5.6/03.make:
      _load_all_certs_from_file in openssl.o
      _php_array_to_X509_sk in openssl.o
  "_sk_shift", referenced from:
      _load_all_certs_from_file in openssl.o
  "_sk_value", referenced from:
      _zif_openssl_x509_parse in openssl.o
      _zif_openssl_csr_new in openssl.o
      _zif_openssl_pkcs7_verify in openssl.o
      _php_openssl_parse_config in openssl.o
      _php_openssl_sockop_set_option in xp_ssl.o
      _capture_peer_certs in xp_ssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libs/libphp5.bundle] Error 1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Happy to try any ideas.

@JeffSafier
Copy link

JeffSafier commented Sep 17, 2020 via email

@integrate-your-mind
Copy link

Hello, I am also experiencing the same issue, I have tried both @tijsverkoyen and @rlayco solutions and have had no success, I cannot get the clang version to revert from version 12.0.0 by reinstalling Xcode tools. My hardware is a 2020 Macbook Pro with Mac OS X Catalina version 10.15.6. Here is a copy of the error:

/private/tmp/php@5.6-20200917-67395-1pyz1tk/php-5.6.40/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2
        readdir_r(dirp, entry);
        ~~~~~~~~~            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here
int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);
^
1 error generated.
make: *** [main/reentrancy.lo] Error 1
make: *** Waiting for unfinished jobs....

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/exolnet/homebrew-deprecated/issues

These open issues may also help:
php@5.6 Library not loaded libicui18n.64.dylib https://github.com/eXolnet/homebrew-deprecated/issues/23
MacOs,  brew install exolnet/deprecated/php@5.6 errors https://github.com/eXolnet/homebrew-deprecated/issues/19
PHP 5.6 and 7.0 doesn't run on Catalina - openssl 1.0.0 needed https://github.com/eXolnet/homebrew-deprecated/issues/14
Adds optional openssl@1.1 compatability patch for php@5.6. https://github.com/eXolnet/homebrew-deprecated/pull/25

At this point, I'm going to stop using PHP5 and just upgrade the older codebase. PHP5 was made 15 years ago so this makes a lot of sense overall. It would be nice if it worked though. Thanks to all who helped.

@rlayco
Copy link

rlayco commented Sep 17, 2020

I'm still struggling to get this to work. I'm setting up a new macbook, starteds from scratch with everything up to date. I'm using the patched version of php 5.6, patched it manually using instructions in this thread. Other things I've tried:

-install older version of Xcode CLT via @rlayco comment - still not working after rebuild of php

-install older version of icu4c via @tijsverkoyen comment - still not working, but with message that "A full installation of Xcode.app is required to compile this software. Installing just the Command Line Tools is not sufficient."

-install full Xcode from app store, try again and still not working.

-install older version of llvm, no change so uninstalled.

Currently I'm getting a clang error but I don't know if it's the one others have encountered:

Last 15 lines from /Users/jarrodpyper/Library/Logs/Homebrew/php@5.6/03.make:
      _load_all_certs_from_file in openssl.o
      _php_array_to_X509_sk in openssl.o
  "_sk_shift", referenced from:
      _load_all_certs_from_file in openssl.o
  "_sk_value", referenced from:
      _zif_openssl_x509_parse in openssl.o
      _zif_openssl_csr_new in openssl.o
      _zif_openssl_pkcs7_verify in openssl.o
      _php_openssl_parse_config in openssl.o
      _php_openssl_sockop_set_option in xp_ssl.o
      _capture_peer_certs in xp_ssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libs/libphp5.bundle] Error 1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Happy to try any ideas.

The error you've got is from open SSL. What is the version of your open SSL?

$ openssl version
OpenSSL 1.1.1g 21 Apr 2020

@rlayco
Copy link

rlayco commented Sep 17, 2020

Hello, I am also experiencing the same issue, I have tried both @tijsverkoyen and @rlayco solutions and have had no success, I cannot get the clang version to revert from version 12.0.0 by reinstalling Xcode tools. My hardware is a 2020 Macbook Pro with Mac OS X Catalina version 10.15.6. Here is a copy of the error:

/private/tmp/php@5.6-20200917-67395-1pyz1tk/php-5.6.40/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2
        readdir_r(dirp, entry);
        ~~~~~~~~~            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here
int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);
^
1 error generated.
make: *** [main/reentrancy.lo] Error 1
make: *** Waiting for unfinished jobs....

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/exolnet/homebrew-deprecated/issues

These open issues may also help:
php@5.6 Library not loaded libicui18n.64.dylib https://github.com/eXolnet/homebrew-deprecated/issues/23
MacOs,  brew install exolnet/deprecated/php@5.6 errors https://github.com/eXolnet/homebrew-deprecated/issues/19
PHP 5.6 and 7.0 doesn't run on Catalina - openssl 1.0.0 needed https://github.com/eXolnet/homebrew-deprecated/issues/14
Adds optional openssl@1.1 compatability patch for php@5.6. https://github.com/eXolnet/homebrew-deprecated/pull/25

At this point, I'm going to stop using PHP5 and just upgrade the older codebase. PHP5 was made 15 years ago so this makes a lot of sense overall. It would be nice if it worked though. Thanks to all who helped.

Your error is related to the CLANG version too which I previously addressed here. Make sure you have this downloaded from Apple developer - Command_Line_Tools_for_Xcode_11.5.dmg If you downloaded and reinstalled it. Check your version clang --version .Make sure it shows Apple clang version 11.0.3 (clang-1103.0.32.62). If it doesn't revert back to that version. I'm sorry I did not encounter that. We have the same version of Catalina - 10.15.6 though.

@integrate-your-mind
Copy link

integrate-your-mind commented Sep 18, 2020

Hello, I am also experiencing the same issue, I have tried both @tijsverkoyen and @rlayco solutions and have had no success, I cannot get the clang version to revert from version 12.0.0 by reinstalling Xcode tools. My hardware is a 2020 Macbook Pro with Mac OS X Catalina version 10.15.6. Here is a copy of the error:

/private/tmp/php@5.6-20200917-67395-1pyz1tk/php-5.6.40/main/reentrancy.c:139:23: error: too few arguments to function call, expected 3, have 2
        readdir_r(dirp, entry);
        ~~~~~~~~~            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/dirent.h:110:1: note: 'readdir_r' declared here
int readdir_r(DIR *, struct dirent *, struct dirent **) __DARWIN_INODE64(readdir_r);
^
1 error generated.
make: *** [main/reentrancy.lo] Error 1
make: *** Waiting for unfinished jobs....

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/exolnet/homebrew-deprecated/issues

These open issues may also help:
php@5.6 Library not loaded libicui18n.64.dylib https://github.com/eXolnet/homebrew-deprecated/issues/23
MacOs,  brew install exolnet/deprecated/php@5.6 errors https://github.com/eXolnet/homebrew-deprecated/issues/19
PHP 5.6 and 7.0 doesn't run on Catalina - openssl 1.0.0 needed https://github.com/eXolnet/homebrew-deprecated/issues/14
Adds optional openssl@1.1 compatability patch for php@5.6. https://github.com/eXolnet/homebrew-deprecated/pull/25

At this point, I'm going to stop using PHP5 and just upgrade the older codebase. PHP5 was made 15 years ago so this makes a lot of sense overall. It would be nice if it worked though. Thanks to all who helped.

Your error is related to the CLANG version too which I previously addressed here. Make sure you have this downloaded from Apple developer - Command_Line_Tools_for_Xcode_11.5.dmg If you downloaded and reinstalled it. Check your version clang --version .Make sure it shows Apple clang version 11.0.3 (clang-1103.0.32.62). If it doesn't revert back to that version. I'm sorry I did not encounter that. We have the same version of Catalina - 10.15.6 though.

Unfortunately I did download that version but the clang version will not revert on install. It seems like the system just makes you use 12.0.0.

EDIT: I downloaded the actual XCode 11.5, not the CLI tools. Trying that now.

UPDATE:
Error received below after downgrading clang

Target: x86_64-apple-darwin19.6.0
Thread model: posix
Last 15 lines from /Users/romanmondello/Library/Logs/Homebrew/php@5.6/03.make:
      _load_all_certs_from_file in openssl.o
      _php_array_to_X509_sk in openssl.o
  "_sk_shift", referenced from:
      _load_all_certs_from_file in openssl.o
  "_sk_value", referenced from:
      _zif_openssl_x509_parse in openssl.o
      _zif_openssl_csr_new in openssl.o
      _zif_openssl_pkcs7_verify in openssl.o
      _php_openssl_parse_config in openssl.o
      _php_openssl_sockop_set_option in xp_ssl.o
      _capture_peer_certs in xp_ssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libs/libphp5.bundle] Error 1
make: *** Waiting for unfinished jobs....

@Pypeline
Copy link

@rlayco I was very surprised to find I was running LibreSSL 2.8.3, The system must have reverted to it at some point. I have managed to get openSSL back in place but openSSL won't go to 1.1.1g, it keeps giving me 1.1.1d. I have 1.1.1g downloaded but I don't know how to get brew to switch to it. I can't find a way to make "brew switch openssl 1.1" work.

also worried I have messed something else up as trying to reinstall php gets me

==> Reinstalling exolnet/deprecated/php@5.6 --with-openssl-1.1-patch
Error: An exception occurred within a child process:
  RuntimeError: /usr/local/opt/openssl not present or broken
Please reinstall openssl. Sorry :(

brew reinstall openssl gets me OpenSSL 1.1.1d again but does not fix the error during php reinstall.

I'm most likely just ignorant here about something. I've tried so many things that I'm considering wiping out all the brew stuff and starting over from scratch in case I've messed something up with all the random attempts

@JParkinson1991
Copy link
Author

@Pypeline Theres a couple of things i need to clear up here.

LibreSSL 2.8.3 is the default openssl version shipped with Mac's. That is why running $ openssl version gives you LibreSSL 2.8.3 as an output. If i run that command i get the exact same version. If you run $ which openssl it will no doubt return /usr/bin/openssl. Notice how this is not part of the /usr/local directory that homebrew works within.

Pulling back a LibreSSL version does not mean that during PHP@5.6 rebuild the compilers will be using that version. The reason @rlayco will be seeing $ openssl version OpenSSL 1.1.1g 21 Apr 2020 is probably down to the fact he has manually linked homebrew's openssl binary into $PATH (, details of how can be accessed by running brew info openssl@1.1). Again, this is not required for PHP@5.6 compilation however.

The PHP formula actually defines the homebrew openssl install as part of its configure arguments as per below. It does not use system default and hard set's its self to configure against brews openssl install:

--with-openssl=#{Formula["openssl"].opt_prefix}

Now the question is, why can't the install find openssl at /usr/local/opt/openssl? Did you manually move these files to set homebrew's openssl version as the system default?

Side note: Looking at all the recent comments, its plain to see my previous comments stand true and any manual solution is a not a viable one going forward.

@Pypeline
Copy link

@JParkinson1991 Thank you so much for taking the time to explain that.

I could not get brew to pull openssl 1.1.1g. I ended up manually editing the formula file for openssl@1.1 to be the same as https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl@1.1.rb and after reinstalling openssl it used the correct version and then php5.6 reinstalled with NO ERRORS!

The problem really could have been my own doing. When I was in the "try any and every idea" phase I had copied some things over from my old computer's install that was running php5.6 fine from brew. Still don't know the exact problem but the patch was successful. I think some ignorance as to the workings of brew contributed to the problem too. I learned a lot now though.

Thank you again for your work on this problem and time answering questions. I just need 5.6 working long enough to get a project upgraded to a more recent php version.

@ammmze
Copy link

ammmze commented Nov 11, 2020

I would recommend checking out https://github.com/shivammathur/homebrew-php. I just found out about it but it as of now is actively maintained unlike exolnet's version here.

@JParkinson1991
Copy link
Author

Having looked over https://github.com/shivammathur/homebrew-php despite not testing i can second what @ammmze is saying and would recommend people take a look at that project.

@bytehead
Copy link

@JParkinson1991 It definitely works and does it's job 🙃

@pgrenaud
Copy link
Contributor

Hi!

Thank you for your interest in this repository. Unfortunately, this repository will now be archived with no further actions. We are sorry for the inconvenience.

Why are we closing this repository? This repository was only meant as a temporary measure, not a permanent one. Its only purpose was to ease the transition, considering that formulae from the homebrew-core tap are removed almost the day they became unsupported by the vendor. We needed a few more months to allow us to upgrade the code base of the various projects we have. But it was always with the intention of doing those upgrades, not by relying on a repository to keep old php versions artificially alive. We do not condone the use of deprecated software that could lead to serious security vulnerabilities.

Why are we not redirecting to another repository? Redirecting to another repository could be interpreted as an endorsement of said repository. If we were to do such a thing, we would not do it without vetting it first. And we do not wish to put the time and energy required in a vetting process of a third party repository. As the reason why a vetting process would be required, consider this. Before installing a software library on all our developer computers from an untrusted source, we would need to make sure that this software library is free from any malicious code (Trojan, ransomware, etc.), both in the repository itself and in the packaged binaries (the homebrew bottles, if any).

Thank you for your understanding.

@pgrenaud pgrenaud closed this Jan 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.