3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Drupal7でAmazonS3を利用する

3
Posted at

AmazonS3 moudleは composer-manager を利用して必要ライブラリをインストールするが、
awsライブラリが自動で入らず、以下のエラーが出ていたのでそのときのメモ

PHP Fatal error:  Class 'Aws\\Common\\Credentials\\Credentials' not found in /var/www/html/liveup/sites/all/modules/amazons3/amazons3.module on line 519

drush を利用した方が早いかもしないが、未調査)

composerのインストール

$ curl -sS https://getcomposer.org/installer | php

globalコマンドとして登録

sudo mv composer.phar /usr/local/bin/composer

以下管理画面ページで「rebuild composer.json file」を実行

<drupal_url>/admin/config/system/composer-manager

手動でinstallを実行

cd /var/www/html/liveup/sites/default/files/composer
chmow a+w .
composer install

以下管理画面ページでAWSアクセスキーなどを設定

<drupal_url>/admin/config/media/amazons3

標準のダウンロード方法設定

<drupal_url>/admin/config/media/file-system

Amazon Simple Storage Serviceを選択

API rate limit and OAuth tokensなどのエラーが出る場合

github access tokenを作成する

https://github.com/settings/tokens
Generate new tokenで作られた<oauthtoken>を設定

composer config -g github-oauth.github.com <oauthtoken>

auth.jsonが作成されるので、以下に配置

~/.composer/auth.json
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?