[英]Install PHP Extension for PHP 5.6 on OSX with deprecated homebrew/php
today I've update Brew and now I can't install the php56-extensions.今天我更新了 Brew,现在我无法安装 php56-extensions。
On my Mac is installed "php56" and today I had need to install, "php56-redis", but when I had try to install this extension, Brew returned the following error message.在我的 Mac 上安装了“php56”,今天我需要安装“php56-redis”,但是当我尝试安装此扩展时,Brew 返回以下错误消息。
$ brew install php56-redis
Error: No available formula with the name "php56-redis"
==> 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...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
I see on homebrew/php page that this "tap" is deprecated and for now only PHP engine are migrated on php@5.6 but the extensions not works.我在 homebrew/php 页面上看到这个“tap”已被弃用,现在只有 PHP 引擎在 php@5.6 上迁移,但扩展不起作用。
First install exolnet/homebrew-deprecated 首先安装exolnet / homebrew-deprecated
$ brew tap exolnet/homebrew-deprecated
After it install deprecated package 安装不推荐的软件包之后
$ brew install php@5.6
I've found a solution to use old version of homebrew/php on my Mac. 我找到了一个解决方案,在我的Mac上使用旧版本的homebrew / php。
Step 1 第1步
Go to last valid release of homebrew/php for php56 转到php56的homebrew / php的最后一个有效版本
https://github.com/Homebrew/homebrew-php/tree/966f6c318be2d80b4953cd8cdc112b9611eff8d9
https://github.com/Homebrew/homebrew-php/tree/966f6c318be2d80b4953cd8cdc112b9611eff8d9
and download the Zip file. 并下载Zip文件。
homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip
homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip
Step 2 第2步
Go to 去
/usr/local/Homebrew/Library/Taps/homebrew/
and rename the Tap 并重命名Tap
homebrew-php
自制的PHP
in 在
old-homebrew-php
老自制的PHP
Step 3 第3步
Unzip 拉开拉链
homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip
homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip
in 在
/usr/local/Homebrew/Library/Taps/homebrew/
and rename folder in 并重命名文件夹
homebrew-php
自制的PHP
Step 4 第四步
Search your php extension with brew: 使用brew搜索你的php扩展:
$ brew search php56-redis
==> Searching local taps...
homebrew/php/php56-redis
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...
Step 5 第5步
Install pakages without updates: 安装没有更新的pakages:
HOMEBREW_NO_AUTO_UPDATE=1 brew install homebrew/php/<formula>
This will stop the homebrew update for this command. 这将停止此命令的自制程序更新。 If you want to prevent auto update for your shell session, use:
如果要阻止shell会话的自动更新,请使用:
export HOMEBREW_NO_AUTO_UPDATE=1
to set it permanently, add it to your ~/.bash_profile. 要永久设置它,将其添加到〜/ .bash_profile。
Now at 2022, I only found https://github.com/shivammathur/homebrew-php to be still working.现在在 2022 年,我只发现https://github.com/shivammathur/homebrew-php仍在工作。
See Error while doing `brew tap exolnet/homebrew-deprecated` 在执行“brew tap exolnet/homebrew-deprecated”时查看错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.