Setup the Windows Azure SDK for PHP

Author: Ben Lobaugh <ben@lobaugh.net>

Date: Monday, July 25, 2011, 3:57:59 PM

Tags: Tutorial, Setup, SDK

Table of Contents

This article has been depricated

Please see the updated package and how-to on codeplex

Pre-Requisites

Synopsis

This article will provide an overview of the Windows Azure SDK for PHP and its capabilities, as well as show you how to obtain and setup the SDK on a development machine.

Overview of the Windows Azure SDK for PHP

The Windows Azure SDK for PHP is an Open Source project that enables you to easily tap into the powerful Windows Azure API and leverage its resources in your application. The Windows Azure SDK for PHP is made up of three main components, command line tools, code library, and scaffolders, each of which will be explained in further detail.

clip_image002

Library

The Windows Azure SDK for PHP contains several objects for interacting with your Windows Azure PHP application. The following are a few of the features available in the current Windows Azure SDK for PHP, with more coming soon:

  • Storage
    • Provides access to blobs, queues, and table storage APIs
  • Diagnostics
    • Allows manipulation of the diagnostics infrastructure via the REST API
  • Service Management
    • Provides easy access to manage your Windows Azure service
  • Deployment Management
    • Provides easy access to manage all aspects of a deployment
  • Logging
    • Simple way to provide useful logs that are stored in a durable Storage account

Command line tools

The Windows Azure SDK for PHP provides a full set of command line tools that enable to you quickly use scaffolds, build packages, deploy your application, and manage your services.

The following is a list of commands currently available in the Windows Azure SDK for PHP

  • package
    • Project packaging tool. Creates the files needed for deployment to Windows Azure
  • scaffolder
    • Scaffold creation and build tool. Speeds up development of new applications by providing a pre-built application skeleton
  • deployment
    • Deployment management and creation tool
  • certificate
    • Windows Azure certificate management tool
  • storage
    • Windows Azure Storage management tool
  • service
    • Windows Azure service management tool

Scaffolding

The Windows Azure SDK for PHP contains a great scaffolding feature. When you use scaffolds with the Windows Azure SDK for PHP you get access to pre-built applications that you can use to create a skeleton site for your project that will help get you up and running quickly. An example scaffold could be a pre-built blogging application that you quickly run and then only have to configure. No programming required!

Of course you can not only use pre-built scaffolds, but you can create your own completely custom scaffolds out of any project. For example, if you work in a development shop and are constantly deploying the same ecommerce site you can turn that into a scaffold which does all the heavy work of project creation and deployment!

For more information on scaffolding in the Windows Azure SDK for PHP see our Using Scaffolds article

How to get the Windows Azure SDK for PHP

The Windows Azure SDK for PHP is a freely available project hosted on CodePlex. There are two ways in which you may obtain the Windows Azure SDK for PHP, through a code versioning system or direct archive download.

Archive download

If a Subversion or TFS client is not available CodePlex also offers a zip archive. This archive will only contain the official code release and none of the pre-release code will be available.

To obtain the archive visit the Downloads at: http://phpazure.codeplex.com/releases

Subversion

Using Subversion will ensure you always have the most stable up to date version of the Windows Azure SDK for PHP. The project trunk contains the stable pre-release and includes the new features to be released. These new features may not always be documented, however they will always function.

The Subversion repository can be found at: https://PHPAzure.svn.codeplex.com/svn

For more information on using Subversion with CodePlex see: http://codeplex.codeplex.com/Wikipage?title=Source%20Control%20Clients

Team Foundation Server

CodePlex also has support for Team Foundation Server (TFS). The TFS server can be found at: https://tfs.codeplex.com/tfs/TFS10

For more information on using TFS with CodePlex see: http://codeplex.codeplex.com/Wikipage?title=Source%20Control%20Clients

Setup the Windows Azure SDK for PHP files

After downloading the Windows Azure SDK for PHP files you will need to set them up for use. The Windows Azure SDK for PHP does not contain an installer. It is simply a package of files which you can immediately begin to use. To make development a bit easier we recommend putting the Windows Azure SDK for PHP inside the Windows Azure SDK folder that was created when you installed the development pre-requisites.

Place your Windows Azure SDK for PHP file in the following directory:
C:\Program Files\Windows Azure SDK for PHP

Add the Windows Azure SDK for PHP bin location to your PATH

The last piece to be setup is updating the system PATH variable to include the location to the Windows Azure SDK for PHP command line tool. This can be done in a few simple steps.

  • Right click on My Computer and select Properties
  • On the left pane of the properties box click Advanced system settings
    clip_image004
  • Select Environment Variables from the Advanced tab
    clip_image005
  • Scroll down in the System variables box until you find Path
  • Edit Path. At the end of the Variable valueadd the location to the Windows Azure SDK for PHP command line tools:
    • Path if you downloaded the archive: C:\Program Files\Windows Azure SDK for PHP\bin
    • Path if you used version control: C:\Program Files\Windows Azure SDK for PHP\trunk\bin
      clip_image006
  • Click OK three times to save and close all the dialogs

You should now be able to use the Windows Azure SDK for PHP command line tools from the command prompt without navigating to the location of the command line tools first. You will need to restart any open command prompts before your new PATH settings become available.

Testing the Windows Azure SDK for PHP for successful setup

Testing the Windows Azure SDK for PHP to ensure successful setup is as easy as opening a command prompt and typing the name of any of the command line tools into the prompt. If you receive a help message you successfully setup the Windows Azure SDK for PHP.

  • Open a command prompt
  • Type package and press enter
  • The help contents from the package command should be presented to you

clip_image008

 
blog comments powered by Disqus