Gia*_*olo 13 php macos homebrew deprecated php-extension
今天我更新了Brew,现在我无法安装php56-extensions.
在我的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.
Run Code Online (Sandbox Code Playgroud)
我在homebrew/php页面上看到这个"tap"已被弃用,现在只有PHP引擎在php@5.6上迁移,但扩展不起作用.
小智 35
首先安装exolnet / homebrew不推荐使用的软件
$ brew tap exolnet/homebrew-deprecated
Run Code Online (Sandbox Code Playgroud)
安装不推荐的软件包后
$ brew install php@5.6
Run Code Online (Sandbox Code Playgroud)
我找到了一个解决方案,在我的Mac上使用旧版本的homebrew/php.
步骤1
转到php56的homebrew/php的最后一个有效版本
https://github.com/Homebrew/homebrew-php/tree/966f6c318be2d80b4953cd8cdc112b9611eff8d9
并下载Zip文件.
homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip
第2步
去
/usr/local/Homebrew/Library/Taps/homebrew/
Run Code Online (Sandbox Code Playgroud)
并重命名Tap
自制的PHP
在
老自制的PHP
第3步
拉开拉链
homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip
在
/usr/local/Homebrew/Library/Taps/homebrew/
Run Code Online (Sandbox Code Playgroud)
并重命名文件夹
自制的PHP
第4步
使用brew搜索你的php扩展:
$ brew search php56-redis
==> Searching local taps...
homebrew/php/php56-redis
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...
Run Code Online (Sandbox Code Playgroud)
第5步
安装没有更新的pakages:
HOMEBREW_NO_AUTO_UPDATE=1 brew install homebrew/php/<formula>
Run Code Online (Sandbox Code Playgroud)
这将停止此命令的自制程序更新.如果要阻止shell会话的自动更新,请使用:
export HOMEBREW_NO_AUTO_UPDATE=1
Run Code Online (Sandbox Code Playgroud)
要永久设置它,将其添加到〜/ .bash_profile.