Title: Google Cloud Storage 插件
Author: Google
Published: <strong>2017 年 2 月 25 日</strong>
Last modified: 2020 年 9 月 2 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/gcs/assets/icon-256x256.png?rev=1604875)

# Google Cloud Storage 插件

 作者：[Google](https://profiles.wordpress.org/google/)

[下载](https://downloads.wordpress.org/plugin/gcs.0.1.6.zip)

 * [详情](https://cn.wordpress.org/plugins/gcs/#description)
 * [评价](https://cn.wordpress.org/plugins/gcs/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/gcs/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/gcs/#developers)

 [支持](https://wordpress.org/support/plugin/gcs/)

## 描述

Google Cloud Storage 插件可让您将媒体文件上传到 Google Cloud Storage 存储桶。

## 安装

 1. 下载插件并将其放在`/wp-content/plugins/`目录中。
 2. 在 WordPress 管理界面中启用此插件,
 3. 在插件设置界面中配置 Google Cloud Storage 存储桶。
 4. 在 Google Cloud Console 中, 设置存储桶的默认acl, 以便 allUser 可以读取。

根据您的环境, 您可能需要配置一个 Google 服务帐户来调用 API。

要在**适用于PHP 7.2 的 Google App Engine**上运行此插件，无需额外配置即可运行。

要在**Google Compute Engine**或**App Engine Flexible**上运行此插件，您需要执行以下
操作:

 * 访问 Cloud Console, 转到`计算` > `实例`然后选择 WordPress 正在运行的实例。
 * 停止实例。
 * 实例停止后, 点击**编辑**, 您现在可以在**Cloud API 访问范围**下修改范围。将存储
   范围从**只读**更改为**完整**。

如果您想在 Google Cloud Platform 之外运行此插件, 则需要按照以下步骤配置服务帐户:

 * 访问 Cloud Console, 转到`IAM & Admin` > `Service accounts`并创建具有`Storage 
   Object Admin`权限的服务帐户, 然后下载 json 密钥文件。
 * 将 json 密钥文件上传到托管服务器。不要将其放在公共服务区。
 * 将以下行添加到 wp-config.php (用真正的文件路径替换文件路径)。
 * `putenv('GOOGLE_APPLICATION_CREDENTIALS=/secure-place/my-service-account.json');`

## 常见问题

问: 插件崩溃, `No project ID was provided, and we were unable to detect a default
project ID`, 出了什么问题?

答: 请参阅“安装”部分中有关配置服务帐户的部分。

问: 如何在我的 Google Cloud Storage 存储桶上配置默认ACL?

答: 请参阅: https://wordpress.org/support/topic/google-storage-not-work/page/2/#
post-8897852

## 评价

![](https://secure.gravatar.com/avatar/4d924e3c1c293b5e9de4bcc3c9316634b9ab07f4493f7673cc89656b72d690f5?
s=60&d=retro&r=g)

### 󠀁[Close but no cigar](https://wordpress.org/support/topic/close-but-no-cigar-12/)󠁿

 [Chef Tech](https://profiles.wordpress.org/patrouch/) 2023 年 4 月 14 日

I came across a major glitch when trying to export products from Woocommerce. The
export returns an empty csv file (empty except for the header rows) unless I deactivate
this plugin.

![](https://secure.gravatar.com/avatar/923fd335cd962d29489474ec45ea33598bc16c98040fd542a304a01fdadef8bf?
s=60&d=retro&r=g)

### 󠀁[It Works!](https://wordpress.org/support/topic/it-works-2265/)󠁿

 [dioxunil](https://profiles.wordpress.org/dioxunil/) 2022 年 4 月 10 日

Just read what is written in the readme.txt

![](https://secure.gravatar.com/avatar/1c351b2428890f1e9748acedb085d547353119e2075f96401183c601dcfc7382?
s=60&d=retro&r=g)

### 󠀁[major problems](https://wordpress.org/support/topic/major-problems-11/)󠁿

 [bart2016](https://profiles.wordpress.org/bart2016/) 2021 年 6 月 10 日

it works, but with major problems. by default, it changes the media storage of WP
to google storage, but after this plugin is installed, user cannot install any other
extensions, because it will try to install into gs://xxx

![](https://secure.gravatar.com/avatar/3039c023ff16191649c7cd9156fcdf7262a14f7127cf41496c3a9a39ad1c1280?
s=60&d=retro&r=g)

### 󠀁[not working](https://wordpress.org/support/topic/not-working-3314/)󠁿

 [aelsharawi](https://profiles.wordpress.org/aelsharawi/) 2020 年 7 月 1 日

Google…you should not do that! poor insturction, not working either way API or Json
file, maybe as I am under cloudflare? don’t know, what about the compatibility with
other cdn plugins?

![](https://secure.gravatar.com/avatar/b76225f409e42b614d01e1788da075062004de1026d75051db8664e071199cc2?
s=60&d=retro&r=g)

### 󠀁[Useless in PHP 7.2 / Inútil en PHP 7.2](https://wordpress.org/support/topic/useless-in-php-7-2-inutil-en-php-7-2/)󠁿

 [neoacevedo](https://profiles.wordpress.org/neoacevedo/) 2018 年 7 月 20 日

Simply it isn’t activated on PHP7.2 so you HAVE TO use PHP < 7.1 in order to activate
and use it.

![](https://secure.gravatar.com/avatar/fc71ae7a02caef8011ea21629998df6ca3f968c869ac2fa7ccaf181437f3f10b?
s=60&d=retro&r=g)

### 󠀁[Works great](https://wordpress.org/support/topic/works-great-5080/)󠁿

 [Marco](https://profiles.wordpress.org/marcoherzog/) 2018 年 6 月 19 日

Maybe the instructions should include the updated wording: Visit Cloud Console, 
go to IAM & Admin -> Service accounts and create a service account with Storage 
Admin role and download the json key file. And keep in mind to make the bucket publicly
available: https://cloud.google.com/storage/docs/access-control/making-data-public#
buckets

 [ 阅读所有7条评价 ](https://wordpress.org/support/plugin/gcs/reviews/)

## 贡献者及开发者

「Google Cloud Storage 插件」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Google ](https://profiles.wordpress.org/google/)

[帮助将「Google Cloud Storage 插件」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/gcs)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/gcs/)，查看[SVN仓库](https://plugins.svn.wordpress.org/gcs/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/gcs/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/gcs/)。

## 更新日志

#### 0.1.6

 * 更新所有依赖项

#### 0.1.5

 * 更新所有依赖项
 * 添加 HTTP 标头以跟踪 WordPress 和插件版本

#### 0.1.4

 * 使用最新版本的 Google Cloud Storage 客户端库
 * 更新所有依赖项

#### 0.1.3

 * 在自述文件中添加了用于配置服务帐户的部分
 * 在自述文件中添加了“常见问题”部分
 * 更新了依赖性

#### 0.1.2

 * 在自述文件中添加 “Tested up to” 字段

#### 0.1.1

 * 将供应商目录捆绑在zip文件中

#### 0.1

 * 初始发行

## 额外信息

 *  版本 **0.1.6**
 *  最后更新：**6 年前**
 *  活跃安装数量 **300+**
 *  已测试的最高版本为 **5.5.18**
 *  PHP 版本 ** 5.5 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/gcs/)
 * 标签
 * [google](https://cn.wordpress.org/plugins/tags/google/)[google cloud storage](https://cn.wordpress.org/plugins/tags/google-cloud-storage/)
 *  [高级视图](https://cn.wordpress.org/plugins/gcs/advanced/)

## 评级

 2.7 星（最高 5 星）。

 *  [  2 条 5 星评价     ](https://wordpress.org/support/plugin/gcs/reviews/?filter=5)
 *  [  1 条 4 星评价     ](https://wordpress.org/support/plugin/gcs/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/gcs/reviews/?filter=3)
 *  [  1 条 2 星评价     ](https://wordpress.org/support/plugin/gcs/reviews/?filter=2)
 *  [  3 条 1 星评价     ](https://wordpress.org/support/plugin/gcs/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/gcs/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/gcs/reviews/)

## 贡献者

 *   [ Google ](https://profiles.wordpress.org/google/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/gcs/)