不建议使用homebrew / php。我如何只能通过自制软件安装php7.0?

时间:2019-04-08 17:56:07

标签: php macos homebrew

不建议使用homebrew / php。由于所有公式均已迁移,因此此水龙头现在为空。

我需要为ioncube for php 7.0运行php脚本

我如何只能通过自制软件安装php7.0?

在php中,只有7.1、7.2、7.3版本。谢谢。

UPD。尝试过@bfontaine,没有运气。输出如下。

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)

2 个答案:

答案 0 :(得分:1)

php@7.0不需要openssl 1.0.0,可以重新编译为使用1.1

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

这将在openssl 1.0.0中安装php@7.0,因此不需要安装openssl。请耐心等待,这将需要一些时间(2020年的MacBook Pro大约需要5分钟)

来自Github问题: https://github.com/eXolnet/homebrew-deprecated/issues/14#issuecomment-619991377

答案 1 :(得分:0)

这有点hacky,无法保证它可以正确构建,但是您可以在删除homebrew/php之前强制Homebrew在提交时使用php70。自从Homebrew删除了Bottle(=预编译)文件以来,您必须从源代码进行构建。

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

如果获取部分无效,则可以手动尝试:

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

然后重试:

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