FIX: A PHP application that depends on the REQUEST_URI server variable may fail when a request whose URL contains UTF-8 characters is sent to IIS 7.5

Symptoms

Consider the following scenario:

  • You use the FastCGI module to host a PHP application on a server that is running Internet Information Services (IIS) 7.5.

  • The PHP application depends on the REQUEST_URI server variable.

  • A client request whose URL contains UTF-8 characters is sent to the server running IIS.

In this scenario, the PHP application may fail.

Cause

This problem occurs because the FastCGI module in IIS 7.5 uses ASCII encoding when you set server variables. Therefore, the REQUEST_URI server variable is not set correctly when the URL contains UTF-8 characters.

Resolution

Hotfix information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

To resolve this problem immediately, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=supportNote In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites

You must have IIS 7.5 and the FastCGI module installed to apply this hotfix.

Restart requirement

You must restart the IIS Admin service after you apply this hotfix.

Hotfix replacement information


This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

For all supported x86-based versions of IIS 7.5

File name

File version

File size

Date

Time

Platform

Cgi.dll

7.5.7600.20751

39,936

09-Jul-2010

05:06

x86

Iisfcgi.dll

7.5.7600.20751

73,728

09-Jul-2010

05:07

x86

For all supported x64-based versions of IIS 7.5

File name

File version

File size

Date

Time

Platform

Cgi.dll

7.5.7600.20751

44,544

09-Jul-2010

05:43

x64

Iisfcgi.dll

7.5.7600.20751

86,528

09-Jul-2010

05:45

x64

Cgi.dll

7.5.7600.20751

39,936

09-Jul-2010

05:06

x86

Iisfcgi.dll

7.5.7600.20751

73,728

09-Jul-2010

05:07

x86

For all supported IA-64-based versions of IIS 7.5

File name

File version

File size

Date

Time

Platform

Cgi.dll

7.5.7600.20751

103,424

09-Jul-2010

04:32

IA-64

Iisfcgi.dll

7.5.7600.20751

195,584

09-Jul-2010

04:34

IA-64

Cgi.dll

7.5.7600.20751

39,936

09-Jul-2010

05:06

x86

Iisfcgi.dll

7.5.7600.20751

73,728

09-Jul-2010

05:07

x86

Post-installation instructions

After you apply this hotfix, the FastCGI module can be configured to use UTF-8 encoding when you set server variables. To configure FastCGI to use UTF-8 encoding for a particular set of server variables, set the value of the following registry entry to a list of server variable names:

FastCGIUtf8ServerVariables
Notes

  • The data type of the registry entry is REG_MULTI_SZ.

  • If the registry entry does not exist, you must create it manually.

For example, click start, click run, and then type the following command: 

reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\w3svc\Parameters /v FastCGIUtf8ServerVariables /t REG_MULTI_SZ /d REQUEST_URI\0PATH_INFO

This example configures the FastCGI module to use UTF-8 encoding when you set the REQUEST_URI and PATH_INFO server variables.


Warning Using UTF-8 encoding for server variables may affect how the PHP core and PHP applications work. Make sure that you verify that the PHP applications work as expected after the registry key is changed.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More Information

The FastCGI module also uses ASCII encoding when you set server variables in IIS 7.0. To support UTF-8 encoding for server variable values in IIS 7.0, apply the hotfix that is described in Microsoft Knowledge Base article 980363. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

980363  A hotfix is available that adds features to the FastCGI module in IIS 7.0For more information about PHP on IIS 7.0 or IIS 7.5, visit the following website:

PHP on IIS 7.0For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×