Now that we have PHP setup on our laptop, we can start working with the PHP for Azure SDK. If you don’t have PHP setup, see my previous blog entry:

http://blogs.msdn.com/brunoterkaly/archive/2009/12/19/highly-scalable-php-introduction.aspx

CodePlex – Download the PHPAzure SDK

Untitled-1

What is Windows Azure SDK for PHP Developers?

  • The PHP SDK for Azure is an example of interoperability
  • The SDK is open source and gives developers access to Azure Blobs, Tables & Queues
  • There are also PHP classes for HTTP transport, AuthN/AuthZ, REST & Error Management
  • There is support for Manageability, Instrumentation & Logging support
  • Finally, there is support for storing PHP sessions in Azure Table Storage

Software Requirements

Untitled-1

Eclipse

Eclipse is the development environment. You will probably want to download it.

http://downloads.zend.com/pdt/all-in-one/zend-eclipse-php-galileo-SR1-win32-x86.zip

Figure – Download for Eclipse and Zend Server Community Edition

image

 

Downloads

The following two files can be downloaded from:

 

image

PHPAzure-1.0.1.zip

We’ll work with this documentation momentarily.

image

WindowsAzure4e

This is the website where we’ll learn to code up PHP under Eclipse.

Untitled-1 

Installing Eclipse

This is the setup for Eclipse. I’m assuming that you have already  signed up for an Azure account as http://windows.azure.com

The open source project promises a lot of good stuff. I’m going to try to use some of it.

Managing Projects
    Project wizard targets Azure
    You can convert with a migration tool
    Creates Azure Roles
Managing Storage
    Includes a storage explorer
    Create CR

UD operations on Blogs, Tables, Queues
Deployment
    Just a right mouse click away within Eclipse

You will need to install Java – The Eclipse IDE is built on Java

Untitled-1

I’ve installed the latest version, version 6 update 23.

 image

Downloading Eclipse

There are various versions of Eclipse. The version that I used is:

http://downloads.zend.com/pdt/all-in-one/zend-eclipse-php-galileo-SR1-win32-x86.zip

Install Eclipse into c:\program files

I’m not sure I want to install Eclipse off of my “c:” drive, but instead want “c:\program files,” but that is going to take some admin privileges.

I basically run Winzip as administrator so that I could install to “c:\program files”

Untitled-1

image

Run Eclipse – Let’s Get Started

Untitled-1

Eclipse will ask for a workspace location to save files.

image

Eclipse Is Now Up and Running

The welcome screen below can typically be skipped.

image

Web Server

We have already done 2 things:

  1. A long time ago, when I installed Windows 7, I installed IIS
    1. Go to control panel
    2. “Turn Windows feature

After adding IIS during my Windows 7 install and after using the Web Platform Installer to install PHP, the following directory that I will test locally in is:

c:\inetpub\wwwroot

Creating a New Project

As in any IDE, the best thing to do is to create a project, then some code or markup. I thought I’d start with the code. But we’ll find is that we just plain forgot to do some things.

Figure - New PHP Project

image

Note that I set my directory to “c:\inetpub\wwwroot\”

image

View the “PHP Explorer.”

image

Add a new “PHP File.”

image

Call that new file, “ShowInfo.php.”

image

Type in some code as seen below. The code is:

<?php

phpinfo();

?>

image 

Make sure that when you run your application, you have the following url:

http://localhost/ShowInfo.php

Untitled-1

This, to some extent, is a measure of success. We can even debug the page.

Untitled-1

Select “Debug As, PHP Script.”

Untitled-1

Debugger works, always a welcome sign of progress. It is up to you now to learn about debugger commands. See my previous blogs about debugging for Visual Studio. Eclipse cannot do as many scenarios, but it can do a few. As you can see, all your debugging commands are available.

 

Untitled-1

Windows Azure Tools for Eclipse

These tools extend the Eclipse IDE to more affectively leverage Windows Azure. Go to the Help Menu and select “Install New Software.”

 

Untitled-1

Installation

Click “Add” and type in the following.

Untitled-1

The next few minutes are needed to download and install all the needed files.

Verifying Setup

Go to the “Help” menu and select “About Eclipse”

Untitled-1

Next, click on the button that says, “Installation Details.”

Untitled-1

That’s what mine looks like at this point. I think we are ready to play with Azure some more.

As you can see, my copy of Eclipse has “Windows Azure” menu.

Untitled-1

Conclusion

This concludes the setup. I may go back and edit it if things do not work right once I get further into PHP and Azure. If you run into any surprises, let me know. E-Mail me at bterkaly@microsoft.com.

The next step is to start writing some code that talks to Azure for data.