Install PHP Extension for PHP 5.6 on OSX with deprecated homebrew/php

无人久伴 提交于 2019-11-27 14:48:00

问题


today I've update Brew and now I can't install the 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.

$ 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.


回答1:


First install exolnet/homebrew-deprecated

$ brew tap exolnet/homebrew-deprecated

After it install deprecated package

$ brew install php@5.6



回答2:


I've found a solution to use old version of homebrew/php on my Mac.

Step 1

Go to last valid release of homebrew/php for php56

https://github.com/Homebrew/homebrew-php/tree/966f6c318be2d80b4953cd8cdc112b9611eff8d9

and download the Zip file.

homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip

Step 2

Go to

/usr/local/Homebrew/Library/Taps/homebrew/

and rename the Tap

homebrew-php

in

old-homebrew-php

Step 3

Unzip

homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip

in

/usr/local/Homebrew/Library/Taps/homebrew/ 

and rename folder in

homebrew-php

Step 4

Search your php extension with brew:

$ brew search php56-redis
==> Searching local taps...
homebrew/php/php56-redis
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...

Step 5

Install pakages without updates:

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:

export HOMEBREW_NO_AUTO_UPDATE=1

to set it permanently, add it to your ~/.bash_profile.



来源:https://stackoverflow.com/questions/49649693/install-php-extension-for-php-5-6-on-osx-with-deprecated-homebrew-php

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