Homebrew 如何安装php72-xsl?

Homebrew how to install php72-xsl?

我正在尝试使用以下命令通过 composer 安装 phpdocumentor

composer require --dev phpdocumentor/phpdocumentor dev-master

这会引发以下错误:

Problem 1
- Installation request for phpdocumentor/phpdocumentor dev-master -> satisfiable by phpdocumentor/phpdocumentor[dev-master].
- Conclusion: remove phpdocumentor/reflection-docblock 4.3.0
- Conclusion: don't install phpdocumentor/reflection-docblock 4.3.0
- phpdocumentor/phpdocumentor dev-master requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.0, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.1, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.2, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.3, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.4, 4.3.0].
- Can only install one of: phpdocumentor/reflection-docblock[2.0.5, 4.3.0].
- Installation request for phpdocumentor/reflection-docblock == 4.3.0.0 -> satisfiable by phpdocumentor/reflection-docblock[4.3.0].

在 Google 上的搜索让我想到了以下问题:

根据我在上面提供的 link 中的正确答案,我知道问题的根源是我缺少 PHP 的 XSL。但是,我不知道如何继续为 PHP 7.2 安装 XSL。我在使用 Homebrew 的 MacO 上 运行,我尝试执行以下操作:

brew install php72-xsl

我注意到我的 php.ini 里面有一个 xsl:

;extension=xsl

然而,当我取消注释时,我收到以下警告:

PHP Startup: Unable to load dynamic library 'xsl' (tried: /usr/local/Cellar/php72/7.2.2_13/lib/php/extensions/no-debug-non-zts-20170718/xsl (dlopen(/usr/local/Cellar/php72/7.2.2_13/lib/php/extensions/no-debug-non-zts-20170718/xsl, 9): image not found)

我检查过,文件不存在。实际上整个文件夹 extensions 并不存在。

谁能告诉我应该如何继续安装 xsl

Brew 安装包 php72 包含 xsl 扩展。请撤消对 php.ini.

的手动更改

您似乎对 phpdocumentor/reflection-docblock 有依赖性问题。

您可以尝试以下方法

  • 从您的 composer.json
  • 中删除 phpdocumentor/reflection-docblock
  • 运行 composer update 更新 composer.lock
  • 添加你的 phpdocumentor 依赖项

    composer require --dev phpdocumentor/phpdocumentor

  • 重新添加phpdocumentor/reflection-docblock

    composer require --dev phpdocumentor/reflection-docblock

如果您的 composer.json 中没有 phpdocumentor/reflection-docblock 依赖项,请尝试删除 composer.lock 和供应商文件夹

rm -rf vendor composer.lock

然后运行composer require --dev phpdocumentor/phpdocumentor

这应该解决带有反射文档块的隐式版本约束