Use Google Cloud Storage as the backend for storing media assets in Magento 1.x.
Prior to installation, please make sure you've installed Google Cloud PHP Autoloader. This extension depends on the autoloader to load the essential Google Cloud PHP libraries.
IMPORTANT: Please back up your media files prior to installation. Files lost to accidental deletion cannot be recovered.
See here for documentation.
There are several advantages to cloud-based storage solutions like Google Cloud Storage, including:
- Integration with Google Cloud CDN
- External backups
- Reduced storage costs
Do I have to use a service account key for authentication? Or can I use a different method?
Currently, only service account keys are supported for authentication.
Does the extension provide a CLI?
No, it does not. However, you can perform bucket operations via gsutil
.
Are log files synchronized to the bucket?
No, only media files are synchronized.
Can I synchronize downloadable product files to the bucket?
Yes, it can synchronize both sample and link files.
Fatal error: Uncaught Error: Class 'Google\Cloud\Storage\StorageClient' not found
You need to install and configure Google Cloud PHP Autoloader.
Given keyfile at path /path/to/magento was invalid
You need to create and install a service account key to authenticate with Google Cloud. Verify you've completed the following:
- Generate a Google Cloud service account key with Storage Admin privileges
- Install service account key to local or mounted filesystem with read-only permissions for Magento user
- Under
System > Configuration > Nickolas Burr Extensions > Google Cloud Storage
, make sure:- The extension is enabled
- The Google Cloud project name where the bucket exists is set
- The path to the service account key (e.g.
/etc/gcs.json
) is set - The Google Cloud Storage bucket name (e.g.
mybucket
) is set - [OPTIONAL] If you use the same bucket for multiple projects, you can specify a subdirectory to synchronize to inside the bucket. Otherwise, it will synchronize to
/
.
For more information on Google Cloud service account keys, please see Creating and Managing Service Account Keys.
Several key parts of this extension are derived from the magento-s3 extension.