Tip

Free PHP add-on brings accelerated speed, support to Windows Server

Over the past few years, Microsoft has done a lot of work to optimize the performance of PHP on Windows server so that everyone benefits.

For instance, the folks behind PHP now have the support

    Requires Free Membership to View

of one of the biggest application platforms in the world, the programmers who write in PHP enjoy enhanced performance for their applications on Windows servers, users of said applications wait far less for pages to serve up, and Microsoft sports another feather in its Windows server cap.

One of the ways PHP can be further accelerated in Windows servers is through Windows Cache Extension for PHP, an add-on for PHP under Internet Information Services (IIS). It's a free, open source tool that's BSD-licensed, so its code

More Windows Server tools

HWiNFO utility provides free Windows hardware scans and reports

Sysinternals Autoruns utility beefs up software debugging

Free Windows server utility brings blue screens back to life

 can be ported, reused and redistributed with extremely minimal restrictions. The source code is hosted directly at PHP.net along with full documentation.

The current version of Windows Cache Extension for PHP is 1.01, and a 1.1 beta is available for public download and evaluation. Note, however, that it's not recommended to use the beta in a production environment.

Windows Cache Extension works by caching in the bytecode (the compiled version of PHP scripts), similar to Microsoft's Active Server Page (ASP) caching and acceleration process. Most sites that use PHP tend to run the same scripts, so caching them automatically grants a greater performance boost.

The tool also caches a number of other things, including:

  • files used by PHP scripts (both the scripts themselves and the files called by those scripts)
  • absolute file paths as resolved from relative paths
  • memory occupied by objects and variables, which can be shared between user sessions
  • session handler data

     Note: The last two are only available in the current 1.1. beta version.

Before installing Windows Cache Extension for PHP, make sure you have the correct system requirements -- typicallythe most recent IIS Web server release with PHP versions 5.2.0 or better -- and the FastCGI extension.

The installation process requires a little manual monkeying-about (nothing too outlandish, thankfully). For instance, the program's runtime settings can be manually edited through a .ini file. Among the things that can be changed are the sizes of the various caches and which files (if any) are not to be cached for whatever reason. Note that some of the cache sizes are dependent on each other, so it's important to read the documentation for the settings to determine how one may affect the other.

Right now only x86 versions of the cache extension are available; there's no x64 edition, but the 32-bit version should work as-is in 64-bit Windows servers. It's also recommended that you use the VC9 non-threadsafe version of PHP (which is what's generally recommended for Internet Information Services anyway).

Finally, if you're curious about profiling the application's caching performance, the installation package includes a script that lets you dump out a rundown of Windows Cache Extension for PHP's caching statistics.

ABOUT THE AUTHOR
Serdar Yegulalp has been writing about computers and information technology for more than 15 years for a variety of publications, including InformationWeek and Windows Magazine.


This was first published in July 2010

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.