【问题标题】:使用 PHP 的 Google 身份验证器无法正常工作
【发布时间】:2021-04-24 04:02:27
【问题描述】:

我正在尝试使用项目https://github.com/sonata-project/GoogleAuthenticator 我首先安装了这个项目: composer require sonata-project/google-authenticator 。 在此之后,当我想查看我收到错误的操作时

PHP 致命错误:在第 19 行的 /home/######/vendor/sonata-project/google-authenticator/src/GoogleAuthenticator.php 中找不到接口“Sonata\GoogleAuthenticator\GoogleAuthenticatorInterface”

我是不是忘记了什么?

任何帮助将不胜感激!

【问题讨论】:

    标签: sonata authenticator


    【解决方案1】:

    将下面一行添加到 src 文件夹中的 GoogleAuthenticator.php 文件中

    include_once 'GoogleAuthenticatorInterface.php';
    

    【讨论】:

      【解决方案2】:

      我想你解决了这个问题,或者以某种方式解决了这个问题。但我的答案正在改变

      include_once __DIR__.'/src/FixedBitNotation.php';
      include_once __DIR__.'/src/GoogleAuthenticator.php';
      include_once __DIR__.'/src/GoogleQrUrl.php';
      
      include_once __DIR__.'/src/FixedBitNotation.php';
      include_once __DIR__.'/src/GoogleAuthenticatorInterface.php';
      include_once __DIR__.'/src/GoogleAuthenticator.php';
      include_once __DIR__.'/src/GoogleQrUrl.php';
      

      即添加:include_once __DIR__.'/src/GoogleAuthenticatorInterface.php';

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-11-09
        • 1970-01-01
        • 2023-03-27
        • 1970-01-01
        • 2014-11-17
        • 2012-10-20
        • 1970-01-01
        • 2020-05-18
        相关资源
        最近更新 更多