WordPress on Azure

As I just mentioned in my last post, this ‘ere blog is running in Azure, because I’m a cheapskate and get free hosting from Microsoft.

But it wasn’t as easy as I’d thought.

In the day job I’m doing lots of Azure stuff again. Our esteemed leader wants us to use Platform-as-a-Service where we can, which makes sense as the firm I’m working with don’t want to write anything themselves if they can help it. Buy, not build is their mantra.

So I merrily went to Azure and chose Add New, “WordPress + MySQL”. Entered all the passwords (so many!) and left the wheels to spin. Whoops!

Failure one: no free WordPress PaaS for you!

A few minutes later, red icon, failure: turns out that this needs a credit card that works to be used. It’s a marketplace app and so it’s not covered under the ‘free’ MSDN subscription to Azure. Which is annoying and wasn’t something I realised.

Failure two: no automatic WordPress on IaaS either!

So it’s off to deploy a virtual machine in Azure, then to the Web Platform Installer to install PHP, MySQL and the WordPress gubbins.

All went fine, or so it seems, until… server error 500, failure. A fair bit of digging suggested that diagnosing PHP was the first point of call. PHP uses plain ol’ CGI, and

C:\Program Files (x86)\PHP\v5.5> php-cgi.exe

gave an error indicating the MSVCR110.dll C++ runtime was missing. Now, call me old-fashioned but I’d have hoped the Platform Installer would see that as a pre-requisite…

A quick download and PHP was responding as it should. Next step, permissions: more 500 errors as the PHP CGI couldn’t read the folder where the application was installed. Again I’d have hoped the Platform Installer would sort that out, but a quick trip to StackOverflow to remind myself of the application user identity under IIS 8.5 (“IIS AppPool\AppPoolName“) sorted that out.

One last thing for image uploads

And, it turns out that image uploads need to be written to a folder under the WordPress root folder. I’d only configured read access for that folder to the application user identity so as soon as I went to edit images the URL rewrite module in PHP gave a 500 too. Giving write access to the subfolder where content is being written sorted that out.

And, all done. Well, locally it worked, but Azure refused to serve the site!

Next time: how I fixed that.

Author: Jeremy McGee

I write software, and try to help others do the same.

1 thought on “WordPress on Azure”

Comments are closed.