Due to the popular demand on how to actually host a PHP application on Windows Azure, this post teaches you the easiest way to deploy your PHP applications on the Cloud with the least effort and there is no need to use Windows Azure.
Resources Needed
- PHP Binaries for IIS (http://windows.php.net/)
- MySQL PHP Solution Accelerator (http://code.msdn.microsoft.com/winazuremysqlphp)
- VS2008 SP1/VS2010 Beta 2 w/ Windows Azure SDK
Steps
- Install the MySQL PHP Solution Accelerator.
- Extract the PHP binaries for IIS to the “php” folder in the PhpMyAdminWebRole directory. E.g. “C:SamplesAzureMySQLPHP_x86PhpMyAdminWebRolephp”
- Create a new “Windows Azure Cloud Service” solution in Visual Studio.
- Add an existing project, “PhpMyAdminWebRole” (From the Solution Accelerator), to the solution you created.
- Right click on “Roles” and select “Add-> Web Role Project in solution” and select the project you added in your solution previously.
- Add a new text file in “PhpMyAdminWebRole” and name it “index.php”. The contents of the file is “ <?php echo ‘Hello Cloud’; ?> “
- (Optional). Open Web.config and replace “ <add value=”Admin.aspx”/>” to “ <addvalue=”index.php”/> “
And you are all set! Hit F5 in your Visual Studio to see your work in action on the Development Fabric.
2 Responses to “The Lazy Man’s “PHP Hello Cloud””
Rayonna
Deadly acucrtae answer. You’ve hit the bullseye!
Abe
Smart thinking – a clever way of lkooing at it.