composer install -n --ignore-platform-reqs 不忽略 PHP 扩展 [英] composer install -n --ignore-platform-reqs not ignoring PHP extension

查看:39
本文介绍了composer install -n --ignore-platform-reqs 不忽略 PHP 扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有运行 composer install -n --ignore-platform-reqs --no-dev 的圆构建,但这不再忽略平台要求.

we have circle build that runs composer install -n --ignore-platform-reqs --no-dev but this is not ignoring the platform requirements anymore.

这是我在圈子日志中看到的.--ignore-platform-reqs 显然不起作用.有什么想法吗?

This is what i see in the circle log. The --ignore-platform-reqs is clearly not working. Any ideas why please?

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for drupal/core 8.6.13 -> satisfiable by drupal/core[8.6.13].
    - drupal/core 8.6.13 requires ext-pdo * -> the requested PHP extension pdo is missing from your system.
  Problem 2
    - typo3/phar-stream-wrapper v2.1.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - typo3/phar-stream-wrapper v2.1.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
    - Installation request for typo3/phar-stream-wrapper v2.1.0 -> satisfiable by typo3/phar-stream-wrapper[v2.1.0].

推荐答案

与其使用 --ignore-platform-reqsprovide hack,不如模仿你的使用 platform 设置的环境 - 它为您提供更多控制关于平台要求,它比 provide 更直观(你的包并没有真正提供 ext-fileinfo):

Instead of using --ignore-platform-reqs or provide hack it is better to mimic your environment using platform setting - it gives you more control about platform requirements and it is more intuitive than provide (your package does not really provide ext-fileinfo):

"config": {
    "platform": {
        "php": "7.2.14",
        "ext-fileinfo": "1.0.5",
        "ext-pdo": "7.2.14",
        "ext-session": "7.2.14",
        "ext-iconv": "7.2.14",
        "ext-zip": "1.15.4"
    }
},

您可以通过在生产环境中调用此命令来找到扩展的实际版本(尽管您可能可以为扩展版本添加任何内容 - 使用除 * 以外的任何内容作为 PHP 扩展的约束是非常罕见的):

Actual versions of extensions you may find by calling this command on production environment (although you could probably put anything for extensions version - it is quite uncommon to use anything except * as a constraint for PHP extensions):

composer show -p

这篇关于composer install -n --ignore-platform-reqs 不忽略 PHP 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆