Chen Log


Amazon 官方PHP SDK 套件安裝

leave a comment »

1. 安裝Composer

切換資料夾 cd /usr/local/bin
$ sudo curl -sS | php # 會產生 composer.phar, 產生完就可以執行操作.
sudo chmod a+x composer.phar 變更檔案權限
$ sudo mv composer.phar /usr/local/bin/composer # 搬到全域環境並改名成 composer 方便操作
升級就會需要 sudo composer self-update
自己升級: sudo composer selfupdate # composer 升級
套件升級: composer update

2. 安裝Amazon SDK for PHP 2

  • vim composer.json # 寫入要使用的套件名稱、版本(有問題的話加 sudo 指令)
    1. {
    2. “require”: {
    3. “aws/aws-sdk-php”: “2.*”
    4. }
    5. }
  • composer install # 即可下載安裝(php composer.phar install)(有問題的話加 sudo 指令)
  • 安裝完成後, 程式內容加入 <?php require 'vendor/autoload.php'?> 就可以直接使用.




Written by chenagw

2013/06/16 at 22:13

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: