Posted by & filed under Internet Information Server, PHP.

Having dealt with multiple IIS servers with all kinds of PHP configurations, I’ll let you in on a little secret. PHP 4.4.4 or 4.4.x ISAPI is by far the most stable in any situation. PHP 5.2.x has terrible memory management. If you have a piece of bad code that eats up memory, PHP will not put a stop to it like it should. Here’s an error I received:

The description for Event ID ( 2 ) in Source ( PHP-5.2.2 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: php[3556], PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2061628868 bytes) in Unknown on line 0.

And of course no matter how much memory I allocate, it eats it all up. It’s just a matter of time. Then comes this error:

Faulting application w3wp.exe, version 6.0.3790.3959, faulting module php5ts.dll, version, fault address 0x#.

The obvious solution is to write better code that doesn’t leak memory. However, this isn’t always possible, especially if you are hosting websites run by other people. Many shared hosting accounts on IIS 6.0 experience total PHP shutdown due to one site’s bad code. I have thoroughly tested every 5.2.x line of PHP and they all suffer from this problem. If you want to or need to use PHP 5.2.x, use CGI or Fast-CGI (there’s a beta from as you will not experience any of these memory issues. However Fast-CGI still isn’t as quick as ISAPI, and in terms of the beta, suffers from max uploads of ~1 MB.

Summary for maximum stability/speed combo:

PHP 4.4.x -> use ISAPI

PHP 5.2.x -> CGI (in PHP package) or Fast-CGI (from

Don’t use any other line of PHP since they are no longer supported and have multiple security issues.

(1.05 out of 5)


  1.  BrnDmp » Blog Archive » PHP 5.2.x IIS6