Deploying phpBB on Windows Azure

Posted by Kellanved in Development with the tags , , , , on July 26th, 2010

Windows Azure is the Mircrosoft cloud computing solution. One thing that might come as a surprise is that is specifically intended to run php applications (well, it runs .net too, even java). Long story short, we got introduced to the azure platform during the JumpIn! Camp. The project to get phpBB running on the Azure platform started right there – now it’s showing results.

The prequisite for deploying on Azure is the new support for the native MSSQL driver, which was contributed by Microsoft.
However, a few issues had to be tackled to actually run phpBB in the cloud, namely:

  • SQL Azure is not quite the same as SQL Server and requires a few tweaks
  • Files (uploads) can’t be stored on the local file system, but have to be shared among all instances
  • A few oddities of the Azure platform, especially regarding values reported by the webserver

To expand a bit on the issues: SQL Azure requires primary (“clustered”) keys on all tables, something the default phpBB schema does not deliver. On the flip side, the phpBB MSSQL schema includes partition clauses, which are not supported on Azure. Long story short: it needs a different schema. Files cannot be stored locally in a multi-server environment – for instance a cloud – but have to be shared between all instances. This required a few patches to the phpBB core. Finally, Azure includes a load balancer, which reports an incorrect – internal – port via the ‘SERVER_PORT’ variable. This had to be corrected.

All of these changes can be found in my azure branches of my fork at github: and

So, how to use these? The answer is:

  • Download the source from the bug/9725 branch
  • Create a SQL Azure database
  • Add a firewall rule to allow your own machine to connect to the SQL Azure database
  • Start the phpBB installation, using the bug/9725 branch on your local machine
  • Use the credentials of the SQL Azure database during the install
  • Add the line define(‘AZURE_INSTALL’, true); to the config.php file
  • Delete the install directory
  • Create an Azure package with the phpBB installation you had locally
  • Deploy the package on Azure
  • Add a firewall rule to SQL Azure to allow your phpBB instance to connect with the database

Congrats, you’re running phpBB on Azure.

6 Responses to “Deploying phpBB on Windows Azure”

Posted by Narendra on July 28th, 2010 at 9:31 am:

Hi There,

Why to run phpbb on SQL server when you can deploy mysql into cloud? MySql can be installed inside cloud, am I right?


Posted by Kellanved on July 28th, 2010 at 2:08 pm:

Yes, deployment on Azure/MySQL was entirely possible before. The new thing is pure Azure depoyment.


Posted by Narendra on July 28th, 2010 at 3:25 pm:

Hi There,

Me again. As I believe, the pure Azure deployment will be using Azure table storage/Blob/Queue but not SQL Azure. Correct me if I am wrong.

Please can you provide some links to phpbb/MySql cloud deployment for me!


Posted by BFischer on July 30th, 2010 at 6:09 pm:

Hi, team! May I also have the links to phpbb/MySql cloud deployment?

Posted by Kellanved on August 1st, 2010 at 5:42 pm:

Sorry, there you are on your own. It works on IIS and it works with MySQL, thus I don’t expect any trouble with an Azure/MySQL deployment. As to SQL Azure: the Azure version uses the blob storage, but generally the azure storage is not a replacement for a relational database – SQL Azure is.

Posted by Max on September 15th, 2010 at 1:24 pm:

Wow this seems to a good news, I will have to show it to my windows team.

Commenting is disabled for this blog post