【问题标题】:Google Vision API Requests from IP address ... are blocked来自 IP 地址的 Google Vision API 请求...被阻止
【发布时间】:2017-09-10 14:34:06
【问题描述】:

我使用 Google Vision OCR 使用 PHP 语言从图像中获取文本。 当我用了很长时间。我收到以下错误:

array(1) {
  ["error"]=>
  array(4) {
    ["code"]=>
    int(403)
    ["message"]=>
    string(53) "Requests from IP address ..... are blocked."
    ["status"]=>
    string(17) "PERMISSION_DENIED"
    ["details"]=>
    array(1) {
      [0]=>
      array(2) {
        ["@type"]=>
        string(35) "type.googleapis.com/google.rpc.Help"
        ["links"]=>
        array(1) {
          [0]=>
          array(2) {
            ["description"]=>
            string(32) "Google developer console API key"
            ["url"]=>
            string(75) "https://console.developers.google.com/project/191619933224/apiui/credential"
          }
        }
      }
    }
  }
}

请告诉我原因以及如何解决它。 非常感谢。

【问题讨论】:

  • 可能你已经超出了你的请求限制配额,ip不能再发送请求了。您需要提高限制或更好地处理请求。
  • 你好,你还在用 google vision ocr 和 php 吗?

标签: php ocr google-vision


【解决方案1】:

检查您是否已授权Cloud API console 中的API 并按照sample documentation 中的说明配置您的PHP 客户端。

具体来说,请确保在运行示例之前下载与您的视觉 API 项目关联的 credentials.json 文件并将 GOOGLE_APPLICATION_CREDENTIALS 环境变量设置为凭据路径。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-15
    • 2018-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-13
    • 2019-10-17
    • 1970-01-01
    相关资源
    最近更新 更多