【问题标题】:Unable to run composer install on Magento 2.2.4 setup无法在 Magento 2.2.4 设置上运行 composer install
【发布时间】:2018-12-11 22:19:51
【问题描述】:

我目前正在尝试在我的本地主机上设置现有的 Magento 站点,在克隆存储库后我无法运行 composer install。我收到以下错误:

Problem 1
- Installation request for magento/framework 101.0.4 -> satisfiable by magento/framework[101.0.4].
- magento/framework 101.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
Problem 2
- Installation request for magento/magento2-base 2.2.4 -> satisfiable by magento/magento2-base[2.2.4].
- magento/magento2-base 2.2.4 requires ext-intl * -> the requested PHP extension intl is missing from your system.
Problem 3
- Installation request for magento/product-community-edition 2.2.4 -> satisfiable by magento/product-community-edition[2.2.4].
- magento/product-community-edition 2.2.4 requires ext-intl * -> the requested PHP extension intl is missing from your system.

所以似乎缺少一些 PHP 扩展,但是当尝试通过 brew 安装它们时,会发生以下错误:

Error: No available formula with the name "php71-mcrypt" 
==> Searching for a previously deleted formula (in the last month)...
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.

另外,如果我使用 brew list 它显示 mcrypt 已经安装,但是卸载它并没有帮助。我还尝试完全重新安装 brew 也没有帮助。 我对 Magento 和 Brew 都非常缺乏经验,所以如果我在这里遗漏了任何信息,请告诉我。

【问题讨论】:

    标签: php composer-php homebrew magento2


    【解决方案1】:

    您在 brew 上使用的是哪个 PHP 版本? (php -v) 我有类似的情况,尽管 brew services 显示 7.1 正在运行,但我实际上默认为 7.0。

    【讨论】:

    • php -v 返回 7.0.8 而 MAMP 和 phpinfo();都使用 PHP 7.2
    【解决方案2】:

    按显示的顺序输入以下命令:

    brew update && brew upgrade
    brew tap homebrew/dupes
    brew tap homebrew/versions
    brew tap homebrew/homebrew-php
    brew unlink php70 or 56 
    brew install php71
    curl -s http://php-osx.liip.ch/install.sh | bash -s 7.0
    

    您可以在上面的命令中将 7.0 替换为 7.1 以获得 PHP 的 7.1 版本

    如果php -v 的输出仍然没有与版本 7 相呼应,只需键入此命令即可更新您的路径,它应该会发挥作用,如php-osx.liip.ch 网站上所述。

    export PATH=/usr/local/php5/bin:$PATH
    

    export PATH=”$(brew — prefix homebrew/php/php70)/bin:$PATH
    

    export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH
    

    【讨论】:

    • 感谢您的详细回复。我能够让 php -v 更新到与我在 MAMP (7.2.1) 上使用的版本相同的版本,但是现在当尝试运行 composer install 时,它会抛出 ~130 个错误,表明 PHP ~7.1 是受支持的最高 PHP版本,所以我会尝试重新安装旧版本的 MAMP,看看是否可行。
    猜你喜欢
    • 2020-08-21
    • 2014-11-01
    • 2017-03-25
    • 2018-03-28
    • 2012-11-12
    • 2018-12-28
    • 1970-01-01
    • 2022-07-22
    • 1970-01-01
    相关资源
    最近更新 更多