Tuesday, March 29, 2011

MySQL on Windows Server

These are the steps to install MySQL on a Windows Server.

Download MySQL for windows from here.  Make sure you have IIS and PHP installed.

Run the installer and choose the options that you feel are important for your setup, I usually use the Typical setup.  I also like to include PHPMyAdmin, which you can get from here.

When MySQL is finished installing then you need to set it up.  Run the Server Instance Configuration Wizard and select detailed install.  Then select either Server or developer machine.  I also use Multi-functional database setup.  I use mostly default settings except I like to include the bin directors in the windows path.  I also like to give Root a password but allow root access from remote machines.  Then you are done.

Copy PHPMyAdmin to your InetPub folder and you now have access to your MySQL database from an easy to use front-end application.

That is it.

PHP on Windows Server

So I have spent the past few months working to get a few web servers up and running.  I am finding that the more I can make things available on the web the more information that the users can get access to.  I like how php works and I like programming in it so I am setting up PHP as often as I can.  This is a document on my steps that I have taken to get PHP setup on a Windows 2003 R2 server.  I am also going to include the install of MySQL as well because the two go hand in hand.

First you need to go and download the latest version of PHP from this website.  As of this writing they were on 5.3.6.

While that is downloading, you also need to download the latest version of FastCGI for IIS.  You can get it here.  This is used by PHP for server response.

Start the PHP installer and answer the basic questions.  Make sure to place PHP directly on the C drive.  It works better if there are no spaces in the folder names.  I like to put it right on C:\PHP\.  Select IIS FastCGI as the Web Server Setup.  I also like to make sure that all of the expected extensions are installed and enabled.

When that is installed I like to go to IIS and set the default document to be index.php.  It should have already been added to the list so I just move it up to the top.  Then I create an index.php file in the inetpub folder and put this code inside:

<?php phpinfo(); ?>

Make sure you go to Web Service Extensions in IIS and allow FastCGI Handler.  I also allow Server Side Includes.

Then from any web browser you should be able to browse to your server and see the PHP info presented.  You have now setup PHP on Windows Server 2003.