您必须设置 php-http/httplug-bundle 以使用默认的 http 客户端服务

Posted

技术标签:

【中文标题】您必须设置 php-http/httplug-bundle 以使用默认的 http 客户端服务【英文标题】:You must setup php-http/httplug-bundle to use the default http client service 【发布时间】:2018-04-09 17:37:46 【问题描述】:

我不明白以下问题:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] 您必须设置 php-http/httplug-bundle 以使用默认的 http 客户端 服务。

脚本 Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache 处理 post-update-cmd 事件并以异常 [RuntimeException] 终止 执行“'cache:clear --no-warmup'”> 命令时出错: [Symfony\Component\Config\Definition\Exception\InvalidConfigurati 异常] 。

下面是我的文件 composer.json


"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": 
    "psr-0":  "": "src/", "SymfonyStandard": "app/" 
,
"require": 
    "php": ">=5.3.3",
    "symfony/symfony": "2.8.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "dev-master",
    "doctrine/doctrine-fixtures-bundle": "dev-master",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~3.0",
    "sensio/framework-extra-bundle": "~3.0",
    "incenteev/composer-parameter-handler": "~2.0",
    "sonata-project/admin-bundle": "~2.3@dev",
    "sonata-project/doctrine-orm-admin-bundle": "2.3.4",
    "knplabs/knp-disqus-bundle": "dev-master",
    "hwi/oauth-bundle": "dev-master",
    "kartik-v/bootstrap-star-rating": "dev-master",
    "azine/socialbar-bundle": "dev-master",
    "gregwar/captcha-bundle": "dev-master",
    "knplabs/knp-paginator-bundle": "~2.4",
    "php-http/guzzle6-adapter": "1.1.1",
    "php-http/httplug-bundle": "1.7.1"
,
    "require-dev": 
    "sensio/generator-bundle": "~2.3",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/user-bundle":" ~2.0@dev"
,
"scripts": 
    "post-root-package-install": [
        "SymfonyStandard\\Composer::hookRootPackageInstall"
    ],
    "post-install-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
    ],
    "post-update-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
    ]
,
"config": 
    "bin-dir": "bin"
,
"extra": 
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "symfony-bin-dir": "bin",
    "symfony-var-dir": "var",
    "incenteev-parameters": 
        "file": "app/config/parameters.yml"
    ,
    "branch-alias": 
        "dev-master": "2.5-dev"
    

【问题讨论】:

【参考方案1】:

错误来自 HWI Oauth Bundle:https://github.com/hwi/HWIOAuthBundle/blob/master/DependencyInjection/HWIOAuthExtension.php

根据该代码判断,您的 HTTPlug Bundle 未在内核中激活,而 HWI Oauth Bundle 需要激活它才能使 HWI 包工作。

按照instructions 并将捆绑包添加到您的内核:

new Http\HttplugBundle\HttplugBundle(),

【讨论】:

super 我在我的 appkernel 文件中添加了以下行。 php 并且效果很好。【参考方案2】:

非常感谢,只是我添加了以下行

    class AppKernel extends Kernel

    public function registerBundles()
    
        $bundles = array(
        ...
        new Http\HttplugBundle\HttplugBundle(),
    );

【讨论】:

以上是关于您必须设置 php-http/httplug-bundle 以使用默认的 http 客户端服务的主要内容,如果未能解决你的问题,请参考以下文章

Django 聚合 - 表达式包含混合类型。您必须设置 output_field

您必须设置 php-http/httplug-bundle 以使用默认的 http 客户端服务

Django annotate Concat - 表达式包含混合类型。您必须设置 output_field

yarn android 错误“您必须为 Maven 存储库指定 URL”但它已经设置了吗?

Facebook 身份验证:要使用此 URL,您必须在应用程序的设置中添加有效的原生平台

如果 DEBUG 为 False,您必须设置 settings.ALLOWED_HOSTS。 Django-r-f