If you are developing PHP on Windows for use on Windows Azure, there is a fancy new feature which may catch your attention. First things first, let’s run through the basics of installing the Windows Azure SDK for PHP in order to set up your environment to get ready for PHP development for Windows Azure.
This new feature is part of the Windows Azure PowerShell and Windows Azure Emulators components which is downloadable through the Web Platform Installer.
Install Windows Azure PowerShell and Windows Azure Emulators for PHP
- Open Web Platform Installer via the Windows Azure PowerShell and Windows Azure Emulators deep link.
- Click Run.
- Accept UAC prompt.
- Click Install.
- Click I Accept.
- Go to the kitchen and grab a cup of coffee.
- Click Finish.
How To: Use RunPHP to test a PHP Application on Windows
In order to understand how to use
runphp, let’s quickly build a sample PHP application to show off the functionality of
Now that we have a simple application set up, let’s open a command prompt to use
runphp. I will use Windows PowerShell to execute commands, in order to use runphp, PowerShell will need to be run as Administrator.
To run PowerShell as Administrator, right click on the PowerShell icon and select Run as Administrator.
Navigate to the path which contains your application, then execute the command
There are a number of things going on when executing RunPHP, let’s enumerate the high level steps:
- Copies an
apphost.configfile to the current directory
appcmd.exefrom IIS Express
- Creates a new Website based on the current directory
- Configures a HTTP Handler to map *.php files to
- Starts IIS Express and binds the website to an open port.
To view and test your website, open a browser visit the
localhost address with the appropriate port which the website was bound to during the
Once you finish testing, you can shut down IIS Express by opening the PowerShell window and pressing the ‘Q’ key.
Now that you’ve finishing testing your application on your local machine, you can deploy to Windows Azure Web Sites.