【发布时间】:2017-08-06 10:17:25
【问题描述】:
我收到以下错误:
致命错误:在第 84 行的 /base/data/home/apps/e~brookes-room-usage/1.399853826395726238/record-usage.php 中找不到类“Google\Cloud\Datastore\DatastoreClient”
所以大概我没有正确地将我的应用程序指向那个类。
我已在云控制台上启用了 Datastore API。
我尝试查找有关如何设置与 Datastore API 的 PHP 连接的文档。
我尝试create a settings.yml file using the instructions here,但我不知道我的客户 ID 或客户密码是什么。
# Google credentials and configuration
google_client_id: YOUR_CLIENT_ID
google_client_secret: YOUR_CLIENT_SECRET
google_project_id: YOUR_PROJECT_ID
# options are "cloudsql", "mongodb", or "datastore"
bookshelf_backend: datastore
我需要做什么才能让 Google Cloud 上的 PHP 应用识别 Google\Cloud\Datastore\DatastoreClient 并连接到 Datastore API 以便检索和发布数据?
【问题讨论】:
-
好的,使用这些说明正确编写了 settings.yml 文件。 cloud.google.com/php/getting-started/authenticate-users我还需要什么吗?
-
我需要安装 Composer 吗?
-
所以事实证明,除非您使用第三方库,否则您只能在本地设备上的 Google Cloud 应用程序上运行 PHP 和 Datastore,而不能在 Google Appengine 上运行。
标签: php google-app-engine google-cloud-datastore