Installing the AWS SDK for PHP onto my Raspberry Pi

May 27, 2015 16:14 · 203 words · 1 minute read ec2 php-sdk aws

Just some notes for my own reference on getting the AWS SDK for PHP working on my RaspberryPi.

1. Installed PHP and Apache (needed for this particular project)

pi@raspberrypi ~ $ sudo apt-get install apache2 php5 libapache2-mod-php5

2. Moved my project folder and created the composer.json file (as per the SDK installation instructions).

nano composer.json

3. Popped in the required JSON.

{

    “require”: {

        “aws/aws-sdk-php”: “2.*”

    }

}

4. Ran the installer and … bop-bow! ….

pi@raspberrypi ~/phpscripts/greenmode $ php composer.phar install

Loading composer repositories with package information

Installing dependencies (including require-dev)

Your requirements could not be resolved to an installable set of packages.

  Problem 1

    - aws/aws-sdk-php 2.4.0 requires guzzle/guzzle ~3.7.0 -> satisfiable by guzzle/guzzle[v3.7.0, v3.7.1, v3.7.2, v3.7.3, v3.7.4].

… and

 guzzle/guzzle v3.9.3 requires ext-curl * -> the requested PHP extension curl is missing from your system.

4. Loaded up the php5-curl package ….

pi@raspberrypi /var/www $ sudo apt-get install php5-curl

5. Everything working!

pi@raspberrypi ~/phpscripts/greenmode $ php composer.phar install

Loading composer repositories with package information

Installing dependencies (including require-dev)

  • Installing symfony/event-dispatcher (v2.6.8)

    Downloading: 100%         

  - Installing guzzle/guzzle (v3.9.3)

    Downloading: 100%         

  - Installing aws/aws-sdk-php (2.8.7)

    Downloading: 100%    

Just to be sure … let’s do something …. 

A quick Ec2 iterator script …