Per-site PHP configuration with PHP 5.3 and IIS

About a year ago I wrote an article about how to enable per-site PHP configuration on IIS with FastCGI. The instructions in that article required some non-trivial manipulations of IIS and FastCGI configuration settings. At that time it was one of the primary options for enabling per site php.ini support (other option was to use the htscanner extension for PHP). Now, with PHP 5.3 final release available, it is much simpler to implement the same configuration because PHP 5.3 has built-in support for per-directory INI settings and for user-defined INI files. This post describes how to use these features of PHP 5.3 with IIS to enable per-site and per-directory PHP configuration.

Continue reading “Per-site PHP configuration with PHP 5.3 and IIS”

FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1 – RC

Today IIS team has released the FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1 – Release Candidate. This version is based on FastCGI Extension 1.0 and it adds several important improvements and features. The release is believed to have a quality level suitable for production deployments.

Install the Release Candidate of FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1

Install FastCGI 1.5 RC with Web Platform Installer

or, download:

Upgrade from FastCGI Extension 1.0 and 1.5 Beta releases

If you already have installed FastCGI Extension v1.0 or FastCGI Extesnion v1.5 Beta, then the installation package will upgrade it to version 1.5 – RC. All the related IIS configuration and settings in fcgiext.ini file will be preserved during upgrade. Note that during upgrade from v1.0 the comments in fcgiext.ini will not be updated and will not mention new configuration settings. However the new settings can still be used after upgrade.

Continue reading “FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1 – RC”

IIS 7 URL Rewrite Module support in WordPress 2.8

I am pleased to let everyone know that WordPress development community has added a built-in support for IIS 7 URL Rewrite Module in the upcoming WordPress 2.8 release. Starting with version 2.8 the Permalink Settings page will allow you to easily configure “Pretty Permalinks” URL structure when WordPress is running on IIS 7 with URL Rewrite Module v1.1 installed.

Here is how the process of updating Permalinks structure will look like in WordPress 2.8 on IIS 7:

Continue reading “IIS 7 URL Rewrite Module support in WordPress 2.8”

FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1 – Beta

Today IIS team has released the FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1 – Beta. This version is based on FastCGI Extension 1.0 and it adds several important improvements and features.

Install the Beta of FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1

Install FastCGI with Web PI

or, download:

Upgrade from FastCGI Extension 1.0 release

If you already have FastCGI Extension version 1.0 installed then the installation package will upgrade it to version 1.5. All the related IIS configuration and settings in fcgiext.ini file will be preserved during upgrade. Note that during upgrade the comments in fcgiext.ini will not be updated and will not mention new configuration settings. However the new settings can still be used after upgrade.

Continue reading “FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1 – Beta”

URL Rewrite Module 1.1 for IIS 7

Today IIS team has released the URL Rewrite Module 1.1 for IIS 7. This is an incremental update that contains fixes to the bugs found since the URL Rewrite Module v1.0 has been released in November 2008. If you have version 1.0 installed (file version of rewrite.dll is 7.1.315.0), it is highly recommended you upgrade to version 1.1.

Install the URL Rewrite Module 1.1 for IIS 7 today!

Install URL Rewrite with Web PI

or, download:

Upgrade from URL Rewrite Module 1.0 release

If you have URL Rewrite Module version 1.0 installed, the installation package upgrades it to version 1.1. All rewrite rules in applicationHost.config and web.config files are preserved during upgrade process.

Continue reading “URL Rewrite Module 1.1 for IIS 7”

10 URL Rewriting Tips and Tricks

This post describes some of the tips and tricks that one may find useful when solving URL-based problems for their web server or web site. Each tip/trick has a description of a problem and then an example of how it can be solved with IIS 7 URL Rewrite Module.

  1. Add or Remove Trailing Slash
  2. Enforce Lower Case URLs
  3. Canonical Hostnames
  4. Redirect to HTTPS
  5. Return HTTP 503 Status Code in Response
  6. Prevent Image Hotlinking
  7. Reverse Proxy to Another Site/Server
  8. Preserve Protocol Prefix in Reverse Proxy
  9. Rewrite/Redirect Based on Query String Parameter
  10. Avoid Rewriting of Requests for ASP.NET Web Resources

1. Add or Remove Trailing Slash

Many web applications use “virtual URLs” – that is the URLs that do not directly map to the file and directory layout on web server’s file system. An example of such application may be an ASP.NET MVC application with URL format similar to this: http://stackoverflow.com/questions/60857/modrewrite-equivalent-for-iis-7-0 or a PHP application with URL format that looks like this: http://ruslany.net/2008/11/url-rewrite-module-release-to-web/. If you try to request these URLs with or without trailing slash you will still get the same page. That is OK for human visitors, but may be a problem for search engine crawlers as well as for web analytics services. Different URLs for the same page may cause crawlers to treat the same page as different pages, thus affecting the page ranking. They will also cause Web Analytics statistics for this page to be split up.

Continue reading “10 URL Rewriting Tips and Tricks”

Install PHP with Microsoft Web Platform Installer 2.0

While the task of setting up PHP on IIS was not a difficult one, it anyway required a lot of manual installation and configuration steps. With the PHP 5.2.9-1 release the PHP development community has put a lot of improvements to the PHP installer to make it easy to setup PHP on IIS 5.1, IIS 6.0 and IIS 7.0. The latest PHP installer can be downloaded from the PHP community site.

Now, with the release of Microsoft Web Platform Installer 2.0 Beta (Web PI), the task of enabling PHP on Windows OS has become the easiest it has ever been. Here are the three simple steps you need to follow:

Continue reading “Install PHP with Microsoft Web Platform Installer 2.0”

Setup IIS on Server Core – Windows Server 2008 R2

This post has been updated from its original version to correct the installation instructions, which have changed since the time the post was written in Feb 2009.

With the addition of .NET Framework to Server Core in Windows Server 2008 R2 the Server Core installation option became even more appealing for those who want to use a very low footprint server for hosting their applications. Availability of .NET framework provides the following great benefits:

  1. ASP.NET support – you can now use Server Core to host your ASP.NET applications.
  2. IIS Remote Management – Server Core does not provide any user interface other than command line. But if you prefer to use IIS Manager UI to administer IIS, you can now use IIS Remote Manager to connect to IIS on Server Core and perform all the management tasks from within familiar UI of IIS Manager.
  3. PowerShell – Windows Server 2008 R2 includes IIS PowerShell snapin, which is also available on Server Core.

This post describes how to setup and configure IIS on Server Core in Windows Server 2008 R2. Specifically the following tasks are described:

  • Using oclist and ocsetup commands
  • Basic Installation of IIS
  • Installing ASP.NET
  • Installing PowerShell and IIS snap-in
  • Enabling IIS Remote Management
Continue reading “Setup IIS on Server Core – Windows Server 2008 R2”

Windows Installer for PHP 5.2.9 RC and PHP 5.3 Beta

I am pleased to let everyone know that PHP development community has made significant improvements to the installer in upcoming PHP releases. In particular a number of bugs have been fixed to make the installer work well with FastCGI extension in IIS 5.1 and IIS 6.0 and with FastCGI module in IIS 7.0. Now the installer will do for you many of the configuration steps that previously you had to complete manually by following the instructions in the article Using FastCGI to Host PHP Applications on IIS 7.0. Specifically, the installer will:

  1. Unpack PHP core files and extensions
  2. Make changes to the php.ini to enable necessary extensions and specify correct extension path
  3. Create and configure a new FastCGI process pool for PHP executable
  4. Create a script or handler mapping for *.php extension.

Download the PHP installer for non-thread-safe build of PHP from this location:

Continue reading “Windows Installer for PHP 5.2.9 RC and PHP 5.3 Beta”

URL Rewrite Module – Release to Web

Today IIS team has made the URL Rewrite Module for IIS 7.0 Release To Web (RTW) available for download. This is a final, production-ready release that is officially supported by Microsoft.

Install the URL Rewrite Module for IIS 7.0 RTW today!

Upgrade from Go Live release

If you already have Go Live release of URL Rewrite module installed then the installation package will upgrade it to RTW release. All rewrite rules in applicationHost.config and web.config files will be preserved. Note that system reboot may be necessary when upgrading from Go Live to RTW release.

ASP.NET update

The installer for URL Rewrite module includes an update for ASP.NET runtime. The update has fixes for bugs specific to URL rewriting. The update is applied only if the machine where URL Rewrite module is being installed has .NET Framework version 3.5 SP1 or higher. If required version of .NET Framework is installed after URL Rewrite module has been installed, then the ASP.NET update can be applied by re-running URL Rewrite module installer in repair mode.

Continue reading “URL Rewrite Module – Release to Web”