Craig Marvelley

Software and such

Using Eclipse to Run PHP in Azure DevFabric

[This is a blog post related to the PHP on Azure competition.]

As detailed in my last blog post I had some… problems getting a PHP/Azure development environment set up after creating a Windows 7 partition. Well, I scrapped the partition, said goodbye to my old XP OS and started afresh, and that looks to have done the trick – I’m finally able to deploy PHP applications to development storage on my local machine. I’m none the wiser as to why it didn’t work the first time, which is annoying, but at least it’s working now.

After I reinstalled Windows 7 I took care to install all the automatic updates before I went near any other programmes. After a lot of rebooting I eventually installed IIS and, through the Web Platform Installer, the Azure SDK and the Azure command line tools for PHP, along with their dependencies. Then, I installed Eclipse PDT and, following this excellent article, the Azure plugin for eclipse that Brian Swan wrote a great tutorial on.

I came across a few issues while doing all this that I should detail:

  • I had to set Eclipse to run as an administrator (right click eclipse.exe-> properties -> Compatibility -> Run as administrator) before it would install the plugin and allow me to use it within the application
  • I signed up for the free introductory trial of Azure so that I could follow the tutorial properly and configure a database on Azure

It’s a bit annoying that even when developing an app one has to run against SQL Azure in the cloud (which will eventually incur costs). I’d assumed I’d be able to use SQL Server locally but that doesn’t seem to be the case. Some sort of free quota for use in the development stage would make sense to me.

The really good thing about using the Eclipse plugin is that it brings together the many disparate projects that one needs to leverage to work with PHP on Azure. When I was trying to install all this stuff on my own I got a bit muddled, especially since some of the libraries are installed through the Web Platform Installer. The other advantage of the plugin is one can deploy to the cloud from within Eclipse. I’m not a fan of the Eclipse platform but I have to say in this case it’s a good experience (especially since the alternative is the command line!).

If I’ve one criticism of the documentation Microsoft provide (which is generally well-written and thorough) it’s that there’s no ‘official’ site for PHP on Azure which gives a simple one-page overview of everything – after reading about this stuff for over two weeks I still don’t feel like I’ve grokked it, and without blogs like Brian’s and Maarten’s I’d be struggling. As a PHP developer I’m used to the awesome PHP manual and its direct approach to documentation and perhaps Azure (as far as PHP is concerned) could do with something similar. For developers like me, who are new to Azure and trying to get up to speed quickly in a short space of time (and with little time to read around) that sort of resource would be invaluable.

For the moment though I’m just happy that I can finally start developing my application. It’s been a frustrating week battling to get to the point where I can just write a line of code, but from here on in hopefully it’ll be worth it.