homebrew/php was deprecated. How i can install only php7.0 by homebrew?

為{幸葍}努か 提交于 2020-06-01 05:47:28

问题


homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.

I need run php script for ioncube for php 7.0

How I can install only php7.0 by homebrew?

In php there are only 7.1, 7.2, 7.3 versions. Thx.

UPD. Tried @bfontaine with no luck. Output below.

Warning: Use php70 instead of deprecated homebrew/php/php70
Warning: Use php70 instead of deprecated homebrew/php/php70
Error: No available formula with the name "homebrew/core/php70"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.

UPD 2

➜  homebrew-php git:(16a13e53) brew install --build-from-source homebrew/php/php70
==> Installing php70 from homebrew/php
==> Downloading https://php.net/get/php-7.0.27.tar.bz2/from/this/mirror
==> Downloading from https://www.php.net/distributions/php-7.0.27.tar.bz2
######################################################################## 100.0%
curl: (22) The requested URL returned error: 416
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "php70"
Download failed: https://php.net/get/php-7.0.27.tar.bz2/from/this/mirror

UPD 3

➜  homebrew-php git:(16a13e53) cd
➜  ~ export HOMEBREW_NO_AUTO_UPDATE=1
➜  ~ cd $(brew --prefix)/Homebrew/Library/Taps/homebrew
➜  homebrew git:(stable) ls
homebrew-core     homebrew-php      homebrew-services
➜  homebrew git:(stable) rm -rf homebrew-php
➜  homebrew git:(stable) git clone https://github.com/Homebrew/homebrew-php
Cloning into 'homebrew-php'...
remote: Enumerating objects: 35814, done.
remote: Total 35814 (delta 0), reused 0 (delta 0), pack-reused 35814
Receiving objects: 100% (35814/35814), 6.62 MiB | 1.02 MiB/s, done.
Resolving deltas: 100% (26635/26635), done.
➜  homebrew git:(stable) cd homebrew-php
➜  homebrew-php git:(master) git checkout 16a13e53acd2e77434c3a6e3723136c255ea7f33
Note: checking out '16a13e53acd2e77434c3a6e3723136c255ea7f33'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 16a13e53 Delete more formulae.
➜  homebrew-php git:(16a13e53) brew install --build-from-source homebrew/php
➜  homebrew-php git:(16a13e53) curl 'https://www.php.net/distributions/php-7.0.27.tar.bz2' -o "$(brew --cache homebrew/php/php70)"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.4M  100 13.4M    0     0  2291k      0  0:00:06  0:00:06 --:--:-- 2373k
curl: (16) Error in the HTTP2 framing layer
➜  homebrew-php git:(16a13e53) curl 'https://www.php.net/distributions/php-7.0.27.tar.bz2' -o "$(brew --cache homebrew/php/php70)"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 13.4M  100 13.4M    0     0  2368k      0  0:00:05  0:00:05 --:--:-- 2397k
➜  homebrew-php git:(16a13e53) brew install --build-from-source homebrew/php/php70
==> Installing php70 from homebrew/php
==> Downloading https://php.net/get/php-7.0.27.tar.bz2/from/this/mirror
==> Downloading from https://www.php.net/distributions/php-7.0.27.tar.bz2
######################################################################## 100.0%
curl: (22) The requested URL returned error: 416
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "php70"
Download failed: https://php.net/get/php-7.0.27.tar.bz2/from/this/mirror

➜  homebrew-php git:(16a13e53)

回答1:


It’s a bit hacky and there’s no guarantee it would properly build but you could force Homebrew to use homebrew/php at the commit just before the removal of php70. You’ll have to build it from source since Homebrew removed the bottle (= pre-compiled) files.

export HOMEBREW_NO_AUTO_UPDATE=1
cd $(brew --prefix)/Homebrew/Library/Taps/homebrew
git clone https://github.com/Homebrew/homebrew-php
cd homebrew-php
git checkout 16a13e53acd2e77434c3a6e3723136c255ea7f33

brew install --build-from-source homebrew/php/php70

If the fetch part doesn’t work, you can try it by hand:

curl 'https://www.php.net/distributions/php-7.0.27.tar.bz2' -o "$(brew --cache homebrew/php/php70)"

Then try again:

brew install --build-from-source homebrew/php/php70



回答2:


php@7.0 does not require openssl 1.0.0 it can be recompiled to use 1.1

$ brew tap exolnet/homebrew-deprecated
$ brew reinstall --build-from-source php@7.0 

This will install php@7.0 with openssl 1.0.0, so no openssl installations are needed. Be patient, it will take some time (~5 minutes on a 2020 MacBook Pro)

from Github issue: https://github.com/eXolnet/homebrew-deprecated/issues/14#issuecomment-619991377



来源:https://stackoverflow.com/questions/55579150/homebrew-php-was-deprecated-how-i-can-install-only-php7-0-by-homebrew

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!