问题描述
我正在尝试使用Homebrew在我的MAC机器上安装PHP.我正在使用以下命令:brew install php
I am trying to install PHP on my MAC machine using Homebrew.I am using the following command:brew install php
但是,我遇到以下错误:
However, I am getting the following errors:
Error: No available formula with the name "php"
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.
推荐答案
更新(2018年3月)
2018年2月,php72
公式(PHP的当前版本)已移至核心Homebrew龙头中,并重命名为php
.
Update (March 2018)
In February 2018, the php72
formula (the current version of PHP) has been moved into the core Homebrew tap and renamed as php
.
使用Homebrew安装PHP现在非常容易:
Installing PHP using Homebrew is now as easy as:
$ brew install php
homebrew/php
点击已弃用,并将于3月存档2018年3月31日.
The homebrew/php
tap has been deprecated and will be archived on March 31, 2018.
计划还应迁移其他当前@版本约定,将href ="http://php.net/supported-versions.php" rel ="noreferrer">支持的PHP 版本添加到核心页面(PHP 7.1将是[email protected]
). homebrew/php
存档后,它包含的公式将不再可用.
The plan is to also migrate the other currently supported versions of PHP to the core tap, using the new @
convention for versions (PHP 7.1 will be [email protected]
). After homebrew/php
is archived, the formulas it contains won't be available any more.
PHP生态系统位于homebrew/php
分接头中.您可以在其中找到六个版本的解释器(从5.3
到7.1
),它们的扩展以及一些与PHP相关的工具.
The PHP ecosystem lives in the homebrew/php
tap. You can find there six versions of the interpreter (from 5.3
to 7.1
), extensions for them and some PHP-related tools.
要安装PHP,您必须先安装homebrew/php
点击(只需一次):
In order to install PHP you have to install the homebrew/php
tap first (this is needed only once):
$ brew tap homebrew/php
$ brew install php70
或者您可以通过运行以下步骤一步一步完成这两项操作:
Or you can do both operations in a single step by running:
$ brew install homebrew/php/php70
您可以通过先搜索php
来发现所有这些内容:
You could discover all these by searching php
first:
$ brew search php
这篇关于在MAC上使用Homebrew安装PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!