【问题标题】:Configuring the Google Identity Toolkit for PHP ambiguous installation locations in quickstart example在快速入门示例中为 PHP 不明确的安装位置配置 Google Identity Toolkit
【发布时间】:2015-06-30 20:02:09
【问题描述】:

按照 google identity toolkit for php quickstart(在 Windows 中), (https://developers.google.com/identity/toolkit/web/quickstart/php),步骤 1.9 和 2.1 不明确。

在 :8000 (http//localhost:8000) 上运行 Apache

  • c:\root\public 用于文件
  • c:\root\key 用于 p12 密钥目录
  • c:\root\php 用于私有 php 文件

步骤 1.9:

将 serviceAccountPrivateKeyFile 设置更改为等于 您之前下载的 *.p12 文件。您应该使用完整路径, 以 / 开头并以 *.p12 文件的全名结尾。

在 Windows 中,此路径是否应如下所示:

 - "c:/root/key/key.p12"
 - "c:\root\key\key.p12"
 - "/root/key/key.p12"

2.1

从 GitHub 下载 Google Identity Toolkit PHP 快速入门和 解压它。您还可以找到此快速入门的源代码或 Github 上的客户端库。

这会产生一个文件夹: identity-toolkit-php-master 还压缩了另一个文件夹 gitkit-php-composer-package.zip。这些应该解压缩到哪个目录?

2.3

安装PHP依赖管理工具Composer,以及依赖 本快速入门使用的库。对于 Windows,安装 说明在 Composer 网站上(使用 composer.json 我们包含在快速入门文件夹中的需求文件)。为了 Linux/Mac,只需运行以下命令:

cd identity-toolkit-php-master curl -s https://getcomposer.org/installer | php php composer.phar 安装 php -S localhost:8000 路由.php

从 https//getcomposer.org/doc/00-intro.md#installation-windows 安装,是否应该更改任何默认值?

【问题讨论】:

    标签: php google-identity-toolkit


    【解决方案1】:

    serviceAccountPrivateKeyFile 设置将被 php 的 file_get_contents 读取。我认为绝对的windows路径应该没问题: c:/root/key/key.p12
    我可能对使用的斜线方向有误。如果这不起作用,只需反转斜线即可。

    关于将客户端文件 identity-toolkit-php-client-master 的内容放在哪里,这无关紧要,但我会将它与其他库文件一起放在私有目录中。至于 composer 步骤,我相信它会读取解压缩的 identity-toolkit-php-client-master 中的 composer.json 文件,该文件指定 src 包含相对于其当前位置的文件,因此我将在 composer.json 文件所在的同一目录中安装并运行它位于:identity-toolkit-php-client-master/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-14
      相关资源
      最近更新 更多