简体   繁体   English

必须配置路径“ewz_recaptcha”处的 Symfony 4 Recaptcha 包“public_key”

[英]Symfony 4 Recaptcha bundle "public_key" at path "ewz_recaptcha" must be configured

I'm using symfony 4 and recaptcha bundle from https://packagist.org/packages/excelwebzone/recaptcha-bundle#v1.5.11 , but i don't know why it doesn't work.我正在使用来自https://packagist.org/packages/excelwebzone/recaptcha-bundle#v1.5.11 的symfony 4 和 recaptcha 包,但我不知道为什么它不起作用。 Below is the error i got.下面是我得到的错误。 I configured env google recaptcha variables.我配置了 env google recaptcha 变量。

The file "C:\\xampp\\htdocs\\projects\\symfony-template\\config/packages/ewz_recaptcha.yaml" does not contain valid YAML in C:\\xampp\\htdocs\\projects\\symfony-template\\config/packages/ewz_recaptcha.yaml (which is loaded in resource "C:\\xampp\\htdocs\\projects\\symfony-template\\config/packages/ewz_recaptcha.yaml").文件“C:\\xampp\\htdocs\\projects\\symfony-template\\config/packages/ewz_recaptcha.yaml”在 C:\\xampp\\htdocs\\projects\\symfony-template\\config/packages/ewz_recaptcha.yaml 中不包含有效的 YAML (在资源“C:\\xampp\\htdocs\\projects\\symfony-template\\config/packages/ewz_recaptcha.yaml”中加载)。

yaml file: yaml文件:

    ewz_recaptcha:
      public_key:  HIDDEN
      private_key:  HIDDEN
      # Not needed as "%kernel.default_locale%" is the default value for the locale key
      locale_key:  %kernel.default_locale%

HIDDEN equals keys from google, but i covered it here for security reasons. HIDDEN等于来自 google 的密钥,但出于安全原因,我在这里介绍了它。

Notes:笔记:

First: You have to create config/packages/ewz_recaptcha.yaml首先:您必须创建config/packages/ewz_recaptcha.yaml

Second: YAML file have to valid format:第二:YAML 文件必须是有效的格式:

 ewz_recaptcha:
    public_key:  "here is your public key (this is just example)" 
    private_key: "here is your private key (this is just example too)
    # Not needed as "%kernel.default_locale%" is the default value for the locale key
    locale_key:  %kernel.default_locale%

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Symfony2 EWZ Recaptcha字段未正确验证 - Symfony2 EWZ Recaptcha field not correctly validating Symfony:无法加载类型“ EWZ \\ Bundle \\ RecaptchaBundle \\ Form \\ Type \\ RecaptchaType” - Symfony: Could not load type “EWZ\Bundle\RecaptchaBundle\Form\Type\RecaptchaType” 如何从Drupal API获取Google Recaptcha公钥? - How to get google recaptcha Public key from drupal API? 使用recaptcha - 相对路径问题? - using recaptcha - relative path issue? EWZ_SEARCH捆绑包Symfony Jobeet 2.3到2.8的上下文帮助升级 - Context Help for EWZ_SEARCH bundle Symfony Jobeet 2.3 to 2.8 upgrade Symfony安全性:登录表单验证码 - Symfony Security: Login-form recaptcha 在不使用实体的情况下验证 Symfony 4 中的 Botdetect recaptcha - Validating Botdetect recaptcha in Symfony 4 Without using an entity 如何在URL中发送具有特殊字符的字符串(例如:public_Key)? - How to send string(say: public_Key) having special characters in URL? FOSUser Bundle必须配置路径“fos_user”中的子节点“db_driver” - FOSUser Bundle The child node “db_driver” at path “fos_user” must be configured 为什么在Laravel-sentry上出现“缺少public_key配置”错误? - Why do I get “Missing configuration for public_key” error on Laravel-sentry?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM