PHP-Step 02 – Configuring Eclipse to run under Windows - Setup
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:
https://blogs.msdn.com/brunoterkaly/archive/2009/12/19/highly-scalable-php-introduction.aspx
CodePlex – Download the PHPAzure SDK
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
- Supported Operating System: Windows 7(recommended); Windows Server 2008; Windows Vista
- Required Software
- Windows Vista SP1 (when installing on Windows Vista)
- .NET Framework 3.5 SP1
- IIS 7.0 (with ASP.NET, WCF HTTP Activation and optionally CGI)
- SQL Server 2005 Express Edition (or above)
- Hotfix: Support for FastCGI on the Development Fabric (not required for Windows 7, or Windows Server 2008 SP2 or later)
- Windows Azure SDK 1.0 (November 2009)
Eclipse
Eclipse is the development environment. You will probably want to download it.
https://downloads.zend.com/pdt/all-in-one/zend-eclipse-php-galileo-SR1-win32-x86.zip
Figure – Download for Eclipse and Zend Server Community Edition
Downloads
The following two files can be downloaded from:
PHPAzure-1.0.1.zip
We’ll work with this documentation momentarily.
WindowsAzure4e
This is the website where we’ll learn to code up PHP under Eclipse.
Installing Eclipse
This is the setup for Eclipse. I’m assuming that you have already signed up for an Azure account as https://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
I’ve installed the latest version, version 6 update 23.
Downloading Eclipse
There are various versions of Eclipse. The version that I used is:
https://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”
Run Eclipse – Let’s Get Started
Eclipse will ask for a workspace location to save files.
Eclipse Is Now Up and Running
The welcome screen below can typically be skipped.
Web Server
We have already done 2 things:
A long time ago, when I installed Windows 7, I installed IIS
- Go to control panel
- “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
Note that I set my directory to “c:\inetpub\wwwroot\”
View the “PHP Explorer.”
Add a new “PHP File.”
Call that new file, “ShowInfo.php.”
Type in some code as seen below. The code is:
<?php phpinfo(); ?> |
Make sure that when you run your application, you have the following url:
https://localhost/ShowInfo.php
This, to some extent, is a measure of success. We can even debug the page.
Select “Debug As, PHP Script.”
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.
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.”
Installation
Click “Add” and type in the following.
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”
Next, click on the button that says, “Installation Details.”
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.
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.