Home Brew PHP 7.2.5 Install with cURL

前端 未结 1 1929
情歌与酒
情歌与酒 2021-01-03 01:21

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

相关标签:
1条回答
  • 2021-01-03 01:53

    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.

    1. cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
    2. curl -s https://github.com/dossy/homebrew-core/commit/b75fe286f79e2b89548c5ed1bbe1958313c5c103.patch | patch -p1
    3. 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:

    • depends_on "libxml2"
    • --with-libxml-dir=#{Formula["libxml2"].opt_prefix}

    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.

    0 讨论(0)
提交回复
热议问题