Composer 更新:缺少请求的 PHP 扩展 ext-http [英] Composer update: The requested PHP extension ext-http missing

查看:73
本文介绍了Composer 更新:缺少请求的 PHP 扩展 ext-http的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 symfony 框架和 Composer 创建一个 php 网站.

I am creating a php website using the symfony framework and composer.

  • 操作系统:Windows 10
  • PHP 版本:7.3.2
  • Symfony: 4.2.3 (env: dev, debug: true)
  • 作曲家:1.8.4 (2019-02-11)

当我尝试在项目文件夹中执行 compose update 或当我尝试使用 composer require symfony/swiftmailer-bundle 安装包时,我收到以下错误:

When I try to do compose update inside the projects folder or when I try to install a bundle using composer require symfony/swiftmailer-bundle I get the following error:

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

  Problem 1
    - The requested PHP extension ext-http * is missing from your system.
      Install or enable PHP's http extension.

(上面写着问题 1",但它是唯一列出的问题.)

(It says 'Problem 1', but it is the only problem listed.)

我已经在我的 php.ini 文件中查找了扩展名,但我找不到它.我需要手动安装扩展吗?如果是这样,我在哪里可以找到它?

I already looked for the extension in my php.ini file, but I can't find it. Do I need to install an extension manually? If so, where can I find it?

提前致谢!

推荐答案

解决方案找到了.出于某种原因,我的 composer.json 包含 "ext-http":"*".

The solution is found. For some reason my composer.json contained "ext-http": "*".

"require": {
    "ext-http": "*"
}

删除此行解决了问题.我不知道为什么它包含 "ext-http":"*" 并且我不完全理解为什么删除它会解决问题.(是不是因为正在寻找扩展名,却找不到?)

Removing this line fixed the problem. I don't know why it contained "ext-http": "*" and I don't fully understand why removing it would fix the problem. (Is it because it is looking for the extension, but can not find it?)

(感谢所有试图帮助我解决问题的人!)

(Thank you to everyone trying to help me fix the problem!)

更新:其他答案也可能值得一看.我不再使用 PHP,所以我无法检查这些新答案的正确性.

Update: It might be worth looking at the other answers too. I'm no longer using PHP so I can't check the correctness of these new answers.

这篇关于Composer 更新:缺少请求的 PHP 扩展 ext-http的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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