Amazon EC2 Client in PHP

items>Amazon EC2 Client in PHP
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

This Amazon EC2 client in PHP is a simple, light-weight client app for managing Amazon EC2 images, instances, and key-pairs.


Submitted By: Jinesh@AWS
AWS Products Used: Amazon EC2
Language(s): PHP
Created On: October 5, 2006 4:16 PM GMT
Last Updated: September 21, 2008 9:47 PM GMT

What's New?

  • The following updates were made on 2006-12-15
    • PHP client now uses the 2006-10-01 version of the WSDL
    • PHP client sets the User-Agent HTTP header to ec2-php-2.0/1.2-7816


  • You must have a valid Amazon Web Services developer account.
  • You must be signed up to use Amazon EC2.
  • Requires PHP5.1+ or higher (PHP 5.2 is recommended).
  • Requires the following modules:
    • DOM module
    • OpenSSL module

Running The Sample

  1. Download an expand the attached .zip file.
  2. Edit the ws-amazon-ec2.php file to specify the location of your X.509 certificate and private key (PEM format):
  3. View the phpclient.php file in your browser: http://localhost/phpclient.php
    User name: demo
    Password: myec2man
  4. You can now manage your Amazon EC2 instances.
See the Readme.htm file included in the attachment for more information about this sample.


A good start
Nice simple user interface that's a good starting point for building custom management consoles for EC2 instances. My main complaint is that it uses the AWS SOAP API rather than the Query API, which means that it requires the user to get their X.509 certificate into it, rather than just the Access Key/Secret Key that are easier for most users for find, copy, and paste. For a project I based on this, I replaced the included SOAP API with simpler class.ec2.php found at and further modified class.ec2.php to use HTTP_Request instead of curl.
E. Anuff on June 15, 2008 10:19 PM GMT
Good Start!!!
Works first time for me!!!! Bugs: If you refresh the screen at some points it launches a new EC2! The keys did not show first pass, I added one more key and now it works... How do you get report updates? Great work, good look, good start, MORE MORE MOre we want the next version... Edward M. Goldberg
Edward Goldberg on October 16, 2007 3:22 PM GMT
After defining my AWS variables and opening phpclient.php, this is the error message I get: Parse error: parse error, expecting `'('' in /Library/WebServer/Documents/ec2/code/ws-amazon-ec2-client.php on line 26 This looks promising, and I'd love to put it to use. Can you take a look at the error? I'm running the OS X version of Apache and PHP. Thanks.
pagebuildr on August 10, 2007 10:54 PM GMT
It works well enough
See this thread in the forums뇥. A few additions like specifying what groups of ports should be opened up and it will be fairly complete as far as launching instances is concerned. An tracking how long an instance has been up would be fine. But that tracking time up will be difficult as Amazon instances will not respond on ports unless they are opened up. That may require having a way of checking via the instance id probably via the Amazon keys. As far as what it claims to do is concerned 4 stars is fine.
rcamazon2005 on November 18, 2006 12:05 PM GMT
Without any instances created, I'm showing several errors. The client looks like it still needs some work.
pairwise on October 23, 2006 4:02 PM GMT
We are temporarily not accepting new comments.
©2017, Amazon Web Services, Inc. or its affiliates. All rights reserved.