Latest Posts

Most Popular Posts

With the release of Windows Server 2008 and IIS 7, Microsoft has included PHP5 FASTCGI support. ISAPI is still faster in my opinion, and if used correctly, very stable. PHP uses a 32-bit DLL so it will not work with an x64 system. There are several ports of PHP to x64, but all have proved to be unstable. Below I will outline the steps to install PHP 32-bit on Windows 2008 x64 (and have it stable).

  1. Install the PHP4 or PHP5 package (32-bit) in C:\PHP or wherever you like. Only use the Windows installer from php.net if you do not need any extensions. I would recommend downloading the PHP zip package
  2. Open the Internet Information Services (IIS) Manager. 
  3. Double-click “Handler Mappings” from the main IIS screen.
  4. Click on “Add Script Map.”
  5. Set up the handler mapping for c:\PHP\php5isapi.dll with extension *.php and check to allow the ISAPI extension and execution of scripts.
  6. Double-click “ISAPI & CGI Restrictions” on the main IIS screen. Right-click on PHP and select “Edit Feature Settings” and check “Allow unspecified ISAPI modules.” 
  7. Right-click on the Default Application Pool (or the one you want to use if more than one) and select “Advanced Settings.”
  8. Change the “Enable 32-bit Applications” to True. Click OK. This spawns the App Pool in 32-bit mode, so if you have other modules that need to be run in 64-bit mode, best to separate the website into two App Pools: one 32-bit and one 64-bit.
  9. Restart the server.

Related posts:

  1. PHP 5.2.x ISAPI stability on Windows IIS 6.0
  2. Enabling Internet on fresh Windows Server 2008 install
  3. Install and Boot Windows 7 Beta or Windows Server 2008 R2 Beta on VHD
  4. POP3 Protocol Missing in Windows 2008 / IIS7
  5. Slimming down Windows XP Pro SP2 Install


(No Ratings Yet)

10 Responses to “How to install PHP ISAPI on Windows 2008 IIS7 x64”

  1. Bill
    July 5th, 2008 | 11:47 am

    Good tip. Thanks for sharing. Enabling 32bit in advanced settings is what did it for me.

  2. Brandon
    August 27th, 2008 | 12:00 pm

    Thats alot for the guide, worked out great

  3. September 3rd, 2008 | 5:55 am

    [...] 1. Note that the new system is Windoes 2003 x64 SP2 * Are MySQL and PHP going to be happy under x64? o Looks like IIS will need to run as 32 bit to use PHP Enable 32 bit apps under IIS on x64: To enable IIS 6.0 to run 32-bit applications on 64-bit Windows 1. Open a command prompt and navigate to the %systemdrive%InetpubAdminScripts directory. 2. Type the following command: cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 "true" o MySQL: Use the x64 version of MySQL o http://www.videotutorialzone.com/web…-and-iis6.html o http://www.iishacks.com/index.php/20…2008-iis7-x64/ [...]

  4. Mike Kay
    February 3rd, 2009 | 8:41 am

    I am having issues installing PHP. The header here is to install on a 64 bit machine, but the msi install fails because it is a 32 bit app. I get an error message that this installer is not for your system. I’m trying to install manually, but it’s difficult. For just the php.ini file edit says it uses the registry key values that don’t exist as there is no install done. Anyway, I am trying to get 32 bit PHP installed on a 64 bit server. If anybody can point me in the right direction – any help would be most appreciated.

  5. May 24th, 2009 | 2:05 pm

    This worked great, I have even tested on IIS 7.5 in Windows 2008 R2 – RC1. Thanks.

  6. Matt
    August 19th, 2009 | 2:02 pm

    I can’t seem to get it to recognize the mhash and pgsql extensions when running as isapi. If i run as php-cgi it works.. Anyone else see this?

  7. September 15th, 2009 | 10:14 am

    THANKS!!!
    I was stuck and your article gave me the tip I was looking for (enable the 32 bit support in IIS pools)
    Thanks for having done this great article, it saved me a lot of time!

  8. Stein-Tore
    October 13th, 2009 | 1:02 am

    Good to the point article.

    Matt wrote: “I can’t seem to get it to recognize the mhash and pgsql extensions when running as isap”.

    I got Win Web Server 2008 R2 x64 & IIS 7.5.
    Running PHP as isapi.

    Tried to load all extensions listed in the php.ini file.

    Some loaded, others didn’t.

    I only need php_mysql.dll which sadly didn’t load.

    Can’t say I have a clue as to why. all dll’s are in the folder extension_dir points to.

  9. Stein-Tore
    October 13th, 2009 | 2:17 am

    Last missing piece for me to get php_mysql extension to work on ISS 7.5 on Windows Web Server 2008 R2 x64:
    copy C:\php\libmysql.dll to C:\Windows\SysWOW64

    So steps to get php_mysql extension loaded:
    1. in php.ini, make sure extension_dir points to where php_mysql.dll is.
    2. in php.ini, enable extension=php_mysql.dll
    3. copy C:\php\libmysql.dll to C:\Windows\SysWOW64

    That does it for me.

  10. October 22nd, 2009 | 4:45 am

    [...] Fehlermeldungen treten denn auf? Hier mal geschaut(?): How to install PHP ISAPI on Windows 2008 IIS7 x64 – IIS Hacks | Server Resources __________________ #fachinformatiker.de im Internet Relay Chat http://wiki.lupo49.de/ | [...]

Leave a reply


How often do you back up your important files?

View Results

Loading ... Loading ...