-
Notifications
You must be signed in to change notification settings - Fork 53
Adds optional openssl@1.1 compatability patch for php@5.6. #25
Adds optional openssl@1.1 compatability patch for php@5.6. #25
Conversation
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.
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.
|
Why not making it the default? |
@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. |
Thank you for your solution @JParkinson1991 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)? |
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. |
@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, |
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 |
@roskoshinsky unless you’re using the formula from my pull requestes you wont have the 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. |
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. |
@roskoshinsky Be sure to replace the 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. |
Thanks @jcapcik i have added extra notes to my first comment highlighting the change to the url. |
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! |
@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.
My assumption is you are trying to install the latest version of xdebug? xdebug dropped compatability for PHP 5.6 with release
Hope that helps |
Thanks for posting this @JParkinson1991 I was only able to get 5.6 working from locally w/ your patch! +1 to merge |
Works for me too! 💪 |
Hey, thanks for the patch, i've been struggling with getting php5.6 working for a legacy project. I seem to be getting
I'm not sure if this is related, but:
|
Just like @prwhitehead , Make is also failing for me. |
I have the same issue :( |
@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:
|
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. |
@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 @JParkinson1991 The output of 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 |
Thank you. In the meantime, I have successfully followed this : php@5.6 Library not loaded libicui18n.64.dylib solution. |
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
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. |
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
This is untested from my end, but one possible solution outside of rolling back xscope would be:
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. |
@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.
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 :) |
What worked for me was, installing an older version of icu4c, by following the steps below: Move to the correct directory inside brew.
Checkout an older version
If you don't trust this, you can find the correct commit-hash, by running After that you can reinstall icu4c
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.
When this is done, reinstall 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:
|
@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. |
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. |
When running brew install --build-from-source php@5.6 --with-openssl-1.1-patch |
@JeffSafier you're going to need to follow @tijsverkoyen's instructions for manually adding the patch. Then you won't need the
|
@JeffSafier @tonylegrone i think the problem faced here 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. |
@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. |
@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. |
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:
Happy to try any ideas. |
This is what I got
jeffsafier@Jeffs-MacBook-Pro lib % brew reinstall --build-from-source
php@5.6
==> *Downloading https://php.net/get/php-5.6.40.tar.xz/from/this/mirror
<https://php.net/get/php-5.6.40.tar.xz/from/this/mirror>*
Already downloaded:
/Users/jeffsafier/Library/Caches/Homebrew/downloads/ab2ea146f7d8c5258e6d33e9522dac5528cbc3e966bc6e5689fa57860dbb5441--php-5.6.40.tar.xz
==> *Reinstalling **exolnet/deprecated/php@5.6*
==> *Patching*
==> *Patching*
Error: Failure while executing; `patch -g 0 -f -p1` exited with 1. Here's
the output:
patching file acinclude.m4
Hunk #1 FAILED at 441.
Hunk #2 FAILED at 456.
Hunk #3 FAILED at 491.
Hunk #4 FAILED at 503.
Hunk #5 FAILED at 2419.
5 out of 5 hunks FAILED -- saving rejects to file acinclude.m4.rej
patching file Zend/zend_compile.h
Hunk #1 FAILED at 414.
1 out of 1 hunk FAILED -- saving rejects to file Zend/zend_compile.h.rej
patching file Zend/zend_execute.h
Hunk #1 succeeded at 80 with fuzz 2 (offset 9 lines).
…On Wed, Sep 16, 2020, 4:24 PM Tony Legrone ***@***.***> wrote:
@JeffSafier <https://github.com/JeffSafier> you're going to need to
follow @tijsverkoyen <https://github.com/tijsverkoyen>'s instructions for
manually adding the patch. Then you won't need the
--with-openssl-1.1-patch flag.
brew edit ***@***.***
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 ***@***.***
brew reinstall --build-from-source ***@***.***
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADTJ6OZ3TRYJQDRYPG2D7G3SGENIDANCNFSM4MSU4PEQ>
.
|
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:
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. |
The error you've got is from open SSL. What is the version of your open SSL? $ openssl version |
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:
|
@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
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 |
@Pypeline Theres a couple of things i need to clear up here.
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 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: homebrew-deprecated/Formula/php@5.6.rb Line 151 in 8480601
Now the question is, why can't the install find openssl at 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. |
@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. |
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. |
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. |
@JParkinson1991 It definitely works and does it's job 🙃 |
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. |
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.Fixes
#14 #22 #23
Probably Fixes, untested
#17 #19