How to use CakePHP on Windows Azure Web Sites

On June 13, 2013 the Windows Azure Web Sites team announced support for CakePHP in the Windows Azure App Gallery. Check out the post on Installing CakePHP from the Windows Azure Web Site Gallery

One day Last week, I set out to get a simple CakePHP site up and running on Windows Azure Web Sites.

CakePHP is an open source MVC framework for building PHP applications.

CakePHP is a framework, which means ideally, there should not be anything specific to get it working on any platform. As I suspected this is exactly the case, you can simply:

  1. Download CakePHP 2.2.1
  2. Unzip the Package
  3. Deploy to Windows Azure Web Sites
    1. Upload files to Windows Azure Web Sites with FTP or;
    2. Deploy Windows Azure Web Sites applications with Git
  4. Build your Application
    1. I used the CakePHP Blog Tutorial to test the functionality

CakePHP on IIS (aka Windows Azure Web Sites)

One thing to note about hosting CakePHP applications on Windows Azure Web Sites is that your site will be running in IIS. As such you do need to add a web.config to your deployment to get the friendly urls to work as IIS does not know how to decipher .htaccess files [Import Apache mod_rewrite rules using IIS Url Rewrite tool].

Here is a sample web.config file [found on the CakePHP site] for running CakePHP in Windows Azure Web Sites.

Happy Clouding!

10 Responses

Leave a Reply