本記事では、AWS SDK for PHPのインストール手順を説明しています。
Composer
最初にComposerをインストールします。
1 2 3 4 5 6 7 |
[hoge@sample]$ curl -sS https://getcomposer.org/installer | php All settings correct for using Composer Downloading... Composer (version 2.1.6) successfully installed to: /home/hoge/sample/public_html/composer.phar Use it: php composer.phar [hoge@sample]$ |
AWS SDK for PHPのインストール
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
[hoge@sample]$ php composer.phar require aws/aws-sdk-php Using version ^3.191 for aws/aws-sdk-php ./composer.json has been updated Running composer update aws/aws-sdk-php Loading composer repositories with package information Updating dependencies Lock file operations: 6 installs, 0 updates, 0 removals - Locking aws/aws-sdk-php (3.191.4) - Locking guzzlehttp/guzzle (7.3.0) - Locking guzzlehttp/promises (1.4.1) - Locking guzzlehttp/psr7 (1.8.2) - Locking mtdowling/jmespath.php (2.6.1) - Locking ralouphie/getallheaders (3.0.3) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 6 installs, 0 updates, 0 removals - Downloading mtdowling/jmespath.php (2.6.1) - Downloading guzzlehttp/psr7 (1.8.2) - Downloading guzzlehttp/promises (1.4.1) - Downloading guzzlehttp/guzzle (7.3.0) - Downloading aws/aws-sdk-php (3.191.4) - Installing mtdowling/jmespath.php (2.6.1): Extracting archive - Installing ralouphie/getallheaders (3.0.3): Extracting archive - Installing guzzlehttp/psr7 (1.8.2): Extracting archive - Installing guzzlehttp/promises (1.4.1): Extracting archive - Installing guzzlehttp/guzzle (7.3.0): Extracting archive - Installing aws/aws-sdk-php (3.191.4): Extracting archive 2 package suggestions were added by new dependencies, use `composer suggest` to see details. Generating autoload files 1 package you are using is looking for funding. Use the `composer fund` command to find out more! |
インストール確認
実行ディレクトリのvendor以下にSDKがインストールされます。
1 2 3 4 |
ls vendor/aws/ -1 [hoge@sample]$ ls vendor/aws/ -1 aws-sdk-php |