Creating a WIMP Stack (Windows Server, IIS, MySQL, PHP) on Windows Azure


In this post, I’ll take you through how you can create a WIMP stack (regardless of the name!) onto a Windows Azure VM really easy. I’m a guy who likes to configure things graphically, so although you can already create a LAMP stack (Linux, Apache, MySQL, PHP) on a Linux VM on Azure pretty easily, I still love Windows and easy management. In a future post, I’ll also document how to create a WAMP stack (Windows, Apache, MySQL, PHP).

You can host PHP sites much easier on Windows Azure Websites, as there is practically ZERO configuration that you need to do and you get .NET, PHP, node.js and Python support out of the box with FTP and Source Control deployment options baked in.

If you must use MySQL as your database, you can opt for a Database as a Service solution provided by ClearDB through Windows Azure, or you can create a Virtual Machine (Windows or Linux) and use it as a dedicated database.

I’m showing you this tutorial for the sake of completeness and in case you really need to manage everything yourself. But I’m telling you, you are probably better off using Windows Azure Websites + ClearDB.

Let’s start

Create a Windows Server 2012 VM




And in the last step, make sure to open up the FTP and HTTP endpoints in the Load Balancer


Click the checkmark and wait for the machine to be provisioned. About 5 minutes.

Login to the new machine using Remote Desktop

Once the machine is ready and is in the Running state, click on its name (or its row), then click on Connect.


Login with the username and password you specified during creating the VM.

Configure the server by adding Web Server IIS (Internet Information Services) role

The Server Manager window should open by default, but if not, open it.


On the Dashboard, go to Quick start then click on Add roles and features


Click Next, then select “Role-based or feature-based installation”


Leave your server preselected and click Next


Scroll down a bit and check Web Server (IIS) and click on Add Features on the dialog that will popup


Click Next then start the installation process


In a few minutes, IIS should be up and running.


Install PHP and MySQL

You could go ahead and download PHP and MySQL separately and then install/configure them manually, or you could go to the easy route and use the brilliant Microsoft Web Platform Installer, which is what I’ll do.

Open up a browser on the server and download the Microsoft WebPI from here

When the website loads, click on Free download and run the downloaded installer


When the installer loads up, search for PHP and then add your preferred PHP version


then search for MySQL and add your preferred version


Click on Install to begin the installation

The installer will ask you to choose a password for MySQL, choose a password


Continue and Accept the Terms and Conditions. Web PI will now download and install PHP and MySQL.

Testing the PHP installation worked

On the server navigate to the default IIS web root (C:\inetpub\wwwroot) and add an index.php file with the following content


Save the file then go to you should find the PHP information page loading up. Congratulations!


(Optional) Install phpMyAdmin to manage your MySQL database

On the server, open up the phpMyAdmin website and download the latest version, then unzip it as phpmyadmin in C:\inetpub\wwwroot

Following the configuration documentation of phpMyAdmin, create an empty config folder under C:\inetpub\wwwroot\phpmyadmin and make sure to grant Write or Full Control permissions to IUSR user then in a browser, go to and follow the setup wizard.



Finish the setup, move the file to the root of the phpmyadmin folder then delete the config folder, and you’re in!


(Optional) Add FTP role

In order to easily manage your server, let’s add an FTP role. Follow the same process you did at the beginning to enable Web Server (IIS) role, but this time, expand the Web Server (IIS) node and check FTP Server


In about 1 minutes, the FTP role will be installed.

Configure FTP

Add FTP publishing to the Default Web Site


I’m going to select No SSL for now, since I don’t have a certificate


Enable Basic Authentication and for now, grant the Read Write permissions to our administrator user that we created when the machine was provisioned. You can create a different user and use it here if you want.


Due to the way the Windows Azure network functions, we need to enable Passive FTP so we need to do a few more steps.

1. Get the public IP address of the machine from the portal


2. Setup the local passive FTP data channel ports by running the following lines in a command prompt specifying the low data channel port and the high data channel port

cd %windir%system32/inetsrv
appcmd set config /section:system.ftpServer/firewallSupport /lowDataChannelPort:7000 /highDataChannelPort:7002

3. Opening those ports (in this example, they are ports 7000,7001,7002) in the Virtual Machine endpoints on the portal


4. Enable stateful FTP filtering on the firewall by running this command in a command prompt

netsh advfirewall set global StatefulFtp enable

5. Configure the FTP server to allow Passive FTP. Open FTP Firewall support

then type in the public IP of the machine that you got from the portal then hit Apply


6. Restart the FTP site for the changes to take effect


And we are ready!



Now I admit this was a rather lengthy post with some workarounds (to enable FTP for example), but the point is, Windows Azure is a very flexible platform and no matter what you are trying to run, you will find multiple ways to do it.

Since I spent sometime customizing this server, I can now "Capture" it and make the image available for future provisioning, meaning that when I want to create another WIMP server, I simply select it from the list and it is provisioned, preconfigured!
How cool is that?

To recap my disclaimer at the top, if you are simply hosting websites running on .NET, PHP, node.js or Python, you are most probably better of using Windows Azure Websites, as all the above is already handled for you. When it comes to the database and you prefer MySQL, you can either use ClearDB, which provide regular backups, redundancy, etc., or you might choose to create your own Windows/Linux server running MySQL, but beware that the management overhead is now on your shoulders.

In another couple of posts, I’ll show you how to create a standalone MySQL server and use it with Windows Azure websites, how to create a WAMP server and how to create a LAMP server. The choice is yours!

Note: This post is cross posted to my new blog at

Comments (7)

  1. tomcooper says:

    nice blog and great information about Creating a WIMP Stack (Windows Server, IIS, MySQL, PHP) on Windows Azure and <a href=""&gt; mysql manager </a> .

  2. Daniel Steiner says:

    I have followed your tutorial, however opening the ports in the firewall with the command did not work, i had to manually allow them. Yet, Directory Listenig (command LIST response 150 opening BINARY mode data connection.) results in a timeout and can't retreive directory content. any idea how to fix that?

  3. Daniel Steiner says:

    Found the error. You have to open Port 20 in the Azure Endpoint.

  4. Harshil Gandhi says:

    Hi Ahmed

    I have PHP website hosted on windows azure .but it is giving me

    [18-May-2014 06:59:23 America/Los_Angeles] PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in D:homesitewwwrootAdminPanelclassdbclass.php on line 10

    [18-May-2014 06:59:23 America/Los_Angeles] PHP Warning:  mysql_connect(): An attempt was made to access a socket in a way forbidden by its access permissions.

    in D:homesitewwwrootAdminPanelclassdbclass.php on line 10

    [18-May-2014 21:20:12 America/Los_Angeles] PHP Warning:  PHP Startup: Unable to load dynamic library 'D:Program Files (x86)PHPv5.5extphp_sqlsrv.dll' – The specified module could not be found.

    in Unknown on line 0

    following error.

    My Database Server is residing somewhere can you please help me in solving this error.

  5. Shamon says:

    I cant see the php pages in my page

  6. Henrik says:

    Just install Visual C++ Redistributable x64 and it should work…/details.aspx

  7. Sudipto Choudhury says:

    One small typo:

    cd %windir%system32/inetsrv

    should be

    cd %windir%/system32/inetsrv

Skip to main content