I have a localhost development environment on my Mac that uses homebrew\'s php
formula and I\'m pulling my hair out trying to install with a custom path to cURL
I've applied the patch supplied by dossy and it works!
Below are the specific steps to take to solve the issue. More details on what this fixes can be found below.
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
curl -s https://github.com/dossy/homebrew-core/commit/b75fe286f79e2b89548c5ed1bbe1958313c5c103.patch | patch -p1
brew reinstall php --build-from-source
The specific source of issue appears to be that the libxml2
library is needed to replace Mac's built-in libcurl
, which is what ultimately forces PHP's dependency on SecureTransport. These two lines in php.rb were the critical part of the fix for my purposes:
For my specific circumstance I had to reset my editted home brew formula (php.rb) to the source because I had previously editted it. As a result applying the patch didn't work at first. If you've also editted your php.rb formula then I'd reset it to the source: https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/php.rb.
In the linked article on medium.com dossy suggests the follow command to build after applying to patch, brew install php --build-from-source
. If you already have PHP installed you'll need to use reinstall in place of install instead.