我正在OS X El Capitan上使用PHP 7.2,当然是使用Homebrew安装的.现在,我想使用PHP的IMAP扩展中的一些IMAP函数,但是无论我要搜索什么,我都找不到在OSX上添加扩展的方法.
I'm using PHP 7.2 on OS X El Capitan, installed using Homebrew (of course). Now I'd like to use some IMAP functions from PHP's IMAP extension, but no matter what I search for, I can't find a way to add the extension on OSX.
我尝试过的一些方法……当然,我尝试了最常用的方法:
Some things I've tried... I have, of course, tried the most commonly recommended approach:
$ brew reinstall php --with-imap但是这失败了,返回:
Warning: php: this formula has no --with-imap option so it will be ignored!我发现顺便提到的另一种方法也失败了:
Another method, which I found mentioned in passing, also fails:
$ brew install php72-imap Error: No available formula with the name "php72-imap" ==> 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. ==> Searching taps... ==> Searching taps on GitHub... Error: No formulae found in taps.我不确定该朝哪个方向前进.我敢肯定有一种简单的方法(可能已记录在案),但是我还没有找到它.也许我只是在错误的地方寻找并使用了错误的搜索字词...
I'm not exactly sure which direction to go in with this. I'm sure there's an easy, probably documented, way of doing this, but I am yet to find it. Perhaps I'm just looking in the wrong places and using the wrong search terms...
推荐答案凯文·阿贝尔提供了一些已从 Homebrew/core 中删除了PHP扩展.您可以使用以下命令安装IMAP扩展程序:
Kevin Abel is providing some of the PHP extensions removed from Homebrew/core. You can install the IMAP extension with:
brew tap kabel/php-ext brew install php-imap要安装特定版本(例如7.2),请使用:
To install a specific version, such as 7.2 use:
brew install php-ext/php@7.2-imap更多推荐
在OSX上将IMAP添加到PHP 7.2
发布评论