Recent release of FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1 has several new features and improvements that make it easier to run PHP on Windows and IIS. However, all the new features are only available when using Windows XP or Windows Server 2003. FastCGI module on IIS 7.5 in Windows 7 and Windows Server 2008 R2 supports most of these features. FastCGI module on IIS 7 in Windows Vista and Windows Server 2008 does not support those new features yet. The reasons why this happens and the plan for updating FastCGI functionality across all platforms are explained in this post.
FastCGI is supported across 4 different versions of IIS: IIS 5.1/6.0, IIS 7.0 and IIS 7.5. The release models for each of those versions are different:
- FastCGI Extension for IIS 5.1 and IIS 6.0: This is a separate add-on, which is shipped independently of IIS and Windows OS. IIS team has a lot of control over the release schedule and is able to release updates and fix bugs in the extension relatively fast. Thus the new FastCGI features were first introduces in this extension.
- FastCGI Module for IIS 7.0: The module is included in IIS and is therefore a part of the already shipped operating system. Updating the OS component, while possible, requires more time as the changes have to go through the standard Windows Servicing process. The update to the IIS 7.0 FastCGI Module that includes all the new FastCGI features is currently in the release stage and will soon be publicly available for download.
- FastCGI Module for IIS 7.5: FastCGI module is included in IIS and is a part of the operating system. However, the development phase for IIS 7.5 coincided with the release of the FastCGI Extension 1.5 thus the majority (but not all) of the new FastCGI features are available in IIS 7.5. The remaining updates to the FastCGI Module for IIS 7.5 will be done in Windows Server 2008 R2 Service Pack.
The following table lists the new FastCGI features and their availability in different versions of IIS:
| Feature |
IIS 5.1/6.0 |
IIS 7.0 |
IIS 7.5 |
| Monitor Changes to File |
yes |
no |
yes |
| Real-time tuning of MaxInstances |
yes |
no |
yes |
| STDERR stream handling |
yes |
no |
yes |
| Sending termination signal to FastCGI processes |
yes |
no |
yes |
| _FCGI_X_PIPE_ environment variable |
yes |
no |
yes |
| Relaxed enforcement of response headers syntax |
yes |
no |
yes |
| Per-application FastCGI process pools |
yes |
yes |
yes |
| Using UTF-8 encoding for server variable values |
yes |
no |
no |
| IIS CPU Limits support |
yes |
yes* |
yes |
* – to enable IIS CPU Limits support in FastCGI on IIS 7.0 download and install the FastCGI hotfix.
ruslany on February 5th 2010 in FastCGI
481 views
The new release of WinCache Extension for PHP - version 1.0.1 – is available for download. This is a servicing release that has fixes for bugs reported in v1.0. In particular the following fixes and changes have been made in this release:
-
Fixed require_once on PHP5.3. If the files were absolute and similar files were included in different case, require_once was including it twice.
-
Changed relative path cache to act as resolve path cache. Incremented refcounts under aplist lock. Did comparison using InterlockedCompareExchange.
-
Fixed crashes which were happening because aplist refcount and opcode cache refcount can get out of sync due to local cache.
-
Exposed is_local_cache property from ocache_fileinfo and fcache_fileinfo. Stats page will use this to indicate when local opcode data is shown.
-
Updated the wincache.php to pass chart data on query string to ensure that the charts show the same data that is displayed in tables
-
Updated the wincache.php to show whether information about a global or local cache instance is being displayed
-
Changed variable names and comments to indicate rplist is resolve path cache and not just relative path cache
-
Changed wincache.php to use resolve_path instead of relative_path
The new release is available for download from the extension’s home page at: http://www.iis.net/expand/wincacheforphp. The source code for the extension is available on PHP PECL page here: http://pecl.php.net/package/WinCache/1.0.1. The documenation for the extension can be found at http://www.php.net/manual/en/book.wincache.php.
ruslany on January 26th 2010 in PHP
1,393 views
Today IIS team has released to web the FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1. This version is based on FastCGI Extension 1.0 and it adds several important improvements and features. This is a production ready release that is officially supported by Microsoft.
Install FastCGI Extension 1.5 for IIS 6.0 and IIS 5.1
To install the FastCGI Extension 1.5 use the download links at the extension’s home page at http://www.iis.net/expand/fastcgi.
Note: If you already have FastCGI v1.0, v1.5 Beta or v1.5 RC installed, then the installation package will upgrade it to version 1.5 – RTW. 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 »
ruslany on January 18th 2010 in FastCGI
1,557 views
This post describes how to configure IIS to support multiple versions of PHP on the same server. This kind of setup is useful in development environments where it is necessary to test an application with different PHP versions. Also, it is often used in production environments, where many PHP applications are hosted on the same server and some of them have dependency on a particular PHP version.
In order to setup multiple versions of PHP side by side on the same IIS server it is necessary to install PHP manually by following the steps described in php.net documentation for IIS 5.1 and IIS 6.0 and for IIS 7.0 and later. Do not use PHP Windows installer because it does not support side by side installations. Continue Reading »
ruslany on December 16th 2009 in FastCGI, PHP
2,083 views
The Windows Cache Extension 1.0 for PHP – RTW is available for download. This is a final, production-ready release that is provided under an open source BSD license with the source code hosted and maintained on http://pecl.php.net/packages/wincache/.
Install the Windows Cache Extension 1.0 for PHP – RTW
To install the Windows Cache Extension for PHP 5.2 and PHP 5.3, use the download links at the extension’s home page at http://www.iis.net/expand/WinCacheForPhp.
The installation with Web Platform Installer is the easiest as it will automatically place the extension binary into proper location and will update the PHP configuration to enable the extension. Also, if you have the beta or RC release of the extension installed, then Web PI will upgrade it. If you install any PHP application by using Web PI then the Windows Cache Extension for PHP will be offered as an optional component. Continue Reading »
ruslany on November 19th 2009 in PHP
1,586 views
PHP.NET web site is known for its well written and very detailed documentation. The excellent content together with tons of user contributed notes has made the PHP.NET the primary place for getting the help on all PHP related questions.
However there was one thing in the PHP docs that was still not up-to-date. The Windows and IIS-specific installation and configuration sections did not cover the latest changes in Windows, such as IIS 7 and FastCGI. Now I am glad to let everyone know that this part of the PHP documentation is also being updated!
Check out the first batch of updates:
The content is still being updated and there are plans to add more instructions, such as how to install PHP on Windows with PHP Installer, how to easily upgrade to PHP 5.3, how to run multiple PHP versions side by side, etc. If you have any suggestions on the updated content or if you have any additional instructions that you think will be useful, please submit user notes on PHP.NET.
ruslany on November 10th 2009 in FastCGI, PHP
973 views
The URL Rewrite Module 2.0 – Release Candidate is available for download. The release contains functionality and stability improvements and it is believed to have a quality level suitable for production deployments.
Overview
Microsoft URL Rewrite Module 2.0 for IIS 7 is an incremental release that includes all the features from version 1.1, and adds support for outbound response headers and content rewriting. More specifically, it can be used to:
- Replace the URLs generated by a web application in the response HTML with a more user friendly and search engine friendly equivalent
- Modify the links in the HTML markup generated by a web application behind a reverse proxy.
- Fix up the content of any HTTP response by using regular expression pattern matching.
- Modify HTTP request headers and IIS server variables.
- Modify HTTP response headers
Install the URL Rewrite Module 2.0 – RC
To install the URL Rewrite Module 2.0 – RC, use the download links at the module’s home page at http://www.iis.net/extensions/urlrewrite. Continue Reading »
ruslany on November 9th 2009 in URLRewrite
867 views
The Windows Cache Extension 1.0 for PHP – Release Candidate is available for download. The release contains functionality and stability improvements and it is believed to have the quality level suitable for production deployments.
Install the Windows Cache Extension 1.0 for PHP – RC
To install the Windows Cache Extension for PHP 5.2 and PHP 5.3, use the download links at the extension’s home page at http://www.iis.net/extensions/wincacheforphp.
The installation with Web Platform Installer is the easiest as it will automatically place the extension binary into proper location and will update the PHP configuration to enable the extension. Also, if you have the beta release of the extension installed, then Web PI will upgrade it. If you install any PHP application by using Web PI then the Windows Cache Extension for PHP – RC will be offered as an optional component.
If you install the extension manually, then follow the instructions at “Using Windows Cache Extension for PHP“. Continue Reading »
ruslany on October 19th 2009 in PHP
1,118 views
This post describes how to configure IIS 7 to output syntax highlighted source code for PHP files stored on the web server or site. This feature may be useful for development environments when you want to quickly make the source code accessible to other team members.
WARNING: Never attempt to do what is described below on any internet accessible web site! Doing so will greatly compromise the security of your web application.
The HTTP requests for the PHP source code are usually identified by the “.phps” file extension, e.g. http://localhost/index.phps. You will need to configure IIS to understand and handle the HTTP requests with this extension. There are two options for that: to create an IIS handler mapping for “*.phps” or to use the IIS URL Rewrite Module. Continue Reading »
ruslany on October 6th 2009 in PHP, URLRewrite
1,632 views
The FastCGI module in IIS has a configuration setting maxInstances, which controls the number of concurrently running php-cgi.exe processes that IIS creates to process PHP requests. To achieve optimal performance, it is recommended to fine tune this setting for your specific environment starting with 8-10 instances per CPU core (e.g. maxInstances=32 for quad-core CPU).
The Windows Cache Extension for PHP can be used to improve performance of PHP applications running on Windows operating systems. The extension caches the compiled PHP opcode in the shared memory, which helps to avoid re-doing of such CPU intensive operations as parsing and compiling of the PHP source code. This means that when Windows Cache Extension for PHP is enabled, less CPU cycles are required for a web server to process PHP requests. Because of that, the previously configured value for the FastCGI maxInstances setting may not be adequate to load the server’s CPU completely and it may be necessary to increase the value further. Continue Reading »
ruslany on September 2nd 2009 in FastCGI, PHP
2,084 views