Installing Magento Commerce on Windows and IIS (part 1)

If you are like me that still love to stick around with IIS but want to try out Magento Commerce, I have good news. Magento Commerce works quite with some tweak. I have tried this approach on both IIS 6.0 and IIS 7.0 (each have a bit different steps).

First make sure you only use PHP 5.2+ but not version 5.3. You can use the latest MySQL or version 5 and above. Now once you have both PHP and MySQL downloaded, let’s start by configuring IIS to work with PHP first.

On part 1 of this blog, I will start with configuring PHP with IIS7 using FastCGI. If you have Windows 2008 or Windows 7, then you will be using the new IIS version 7. I typically choose the manual PHP installation process. Magento Commerce supports FastCGI, therefore, we can setup our IIS to use FastCGI. IIS 7.0 comes with FastCGI as an option when you install it. Here’s the steps:

1. Make sure FastCGI is installed with your IIS 7 (go to control panel – program and features – Turn Windows feature on or off – under Internet Information Services, make sure CGI is checked (inside world wide web services – application development feature)

IIS features

2. Unzip the PHP into a directory.

3. Next we are going to install PHP using FastCGI. Open IIS manager. In the site that you want the PHP engine to run, click on the “Handler Mappings” and add click on “add module mapping”. Enter the following:

  • Request Path: *.php
  • Module: FastCGIModule
  • Executable: {Your PHP directory, i.e. c:\PHP}\php-cgi.exe
  • Name: PHP via FastCGI

FastCGI PHP

It will prompt whether you want to create a FastCGI application for this application. Just choose “yes”.

4. On your PHP directory, make sure PHP.ini is there. You can copy from “php.ini-recommended” and rename it to “php.ini” to start with. Inside PHP.ini, these are the settings that need to be set right:

* Set fastcgi.impersonate = 1. FastCGI under IIS supports the ability to impersonate security tokens of the calling client. This allows IIS to define the security context that the request runs under.
* Set cgi.fix_pathinfo=1. cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP’s previous behavior was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not care what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting this to 1 will cause PHP CGI to fix its paths to conform to the spec
* Set cgi.force_redirect = 0.
* Set extension_dir to point to a location where PHP extensions reside. Typically, for PHP 5.2.X that would be set as extension_dir = “./ext”
* Enable the required PHP extension by un-commenting corresponding lines, for example:
extension=php_mssql.dll
extension=php_mysql.dll

5. Now we are ready to test the PHP.

To test your PHP installation, on your webroot, create a test php file. You can named it “phpinfo.php”. Inside simply type in the following code:
<$php phpinfo();

6. Open your browser and go to that page that you just created. If everything install correctly, then you should see all the php settings of your PHP installation.

That's it. On the next part, I will cover installing MySQL and preparing the empty database for Magento.

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Twitter
  • Digg
  • Slashdot
  • Technorati
  • LinkedIn
  • MySpace

6 Responses to “Installing Magento Commerce on Windows and IIS (part 1)”

  1. Martin

    Martin  on November 30th, 2009

    I am currently trying to install Magento on IIS 7 with Fast CGI

    I cant get past the Configuration screen when installing magento.

    I have enabled write permissions for the 3 folders for the account IIS_IUSRS
    app/etc
    var
    media

    But I still get a message saying please write enable those folders.

    very strange but can’t get any further.

    Martin

  2. cheekygeek

    cheekygeek  on December 11th, 2009

    Thanks for providing this info.

    I’m curious regarding why NOT to use PHP 5.3 and if this is still valid (Dec. 11, 2009).

    Thanks for any replies!

  3. caricell

    caricell  on December 26th, 2009

    Help! I thought had everything installed per your directions, but I dont get the phopino information. (just the code that I put in).

    Would you have a few minutes to assist?

    Larry

  4. Muliadi

    Muliadi  on December 26th, 2009

    Larry email me at jeo4long at gmail dot com. I will send you my phpinfo file.

  5. Muliadi

    Muliadi  on December 26th, 2009

    cheekygeek – not sure if they ever fix the issue yet on community edition. For some reason, it just won’t work for me on version 5.3 PHP. They may have address this on version 1.4 beta

  6. Muliadi

    Muliadi  on December 26th, 2009

    Martin, try to give the permission to everyone to test if it is indeed permission problem first. Make sure also you apply the permission to all the subfolders.


Leave a Reply

Spam Protection by WP-SpamFree