20

Microsoft's Web Platform Installer made it very easy to get IIS, PHP, xdebugger, etc installed and configured. There seems to be one major drawback. Once a component is installed, there doesn't seem to be a clean way to uninstall or remove it. Specifically, I have both PHP 5.3 and PHP 5.4 installed via WPI and I want to uninstall PHP 5.3

How can this be done?

2 Answers 2

14

Following on from the answer by Dan, the applicationhost.config file is located at C:\Windows\System32\inetsrv\config, and the sections are detailed in it:

  1. Find following entry (or similar entry) in applicationhost.config file and comment it or delete it.

    <application fullPath="C:\Program Files\iis express\PHP\v5.2\php-cgi.exe" 
                 monitorChangesTo="php.ini" activityTimeout="600"
                 requestTimeout="600" instanceMaxRequests="10000">
        <environmentVariables>
            <environmentVariable name="PHP_FCGI_MAX_REQUESTS"
                                 value="10000" />
            <environmentVariable name="PHPRC"
                                 value="C:\Program Files\iis express\PHP\v5.2"/>
        </environmentVariables>
    </application>
    
  2. Find following entry in hanlders section and comment this as well or delete.

    <add name="PHP52_via_FastCGI"
         path="*.php"
         verb="GET,HEAD,POST"
         modules="FastCgiModule"
         scriptProcessor="C:\Program Files (x86)\iis express\PHP\v5.2\php-cgi.exe"
         resourceType="Either" />
    

This is simply the configuration file sitting behind the IIS Manager console, the same result can be achieved by opening the IIS Manager Console, and then opening the FastCGI settings and deleting the reference to PHP 5.3, and then opening the handler mapping section and removing the mapping for PHP 5.3.

1
  • I can't find PHP tag entry here in entire file :( Jul 12, 2020 at 20:37
3

A similar question has been asked on Server Fault.

Open %userprofile%\documents\iisexpress\config\applicationhost.config file and

Find following entry (or similar entry) in applicationhost.config file and comment it or delete it.

<application fullPath="C:\Program Files\iis express\PHP\v5.2\php-cgi.exe" monitorChangesTo="php.ini" activityTimeout="600" requestTimeout="600" instanceMaxRequests="10000">
            <environmentVariables>
                <environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
                <environmentVariable name="PHPRC" value="C:\Program Files\iis express\PHP\v5.2" />
            </environmentVariables>
        </application>

Find following entry in hanlders section and comment this as well or delete.

    <add name="PHP52_via_FastCGI" path="*.php" verb="GET,HEAD,POST"
 modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\iis
 express\PHP\v5.2\php-cgi.exe" resourceType="Either" />

By default Web Platform Installer installs PHP to %programfiles%\iis express\php. so open %programfiles%\iis express\php\ folder and delete the php version folder that you no longer need (don't forget to remove relavant entries from applicationhost.config as mentioned in step 1 and 2 above)

2
  • Thanks, Dave. I actually saw that question. The only problem is I don't have an iisexpress folder or any file called applicationhost.config on my system
    – JannieT
    Oct 3, 2012 at 12:53
  • 1
    @JannieT A bit late but don't you have a file under C:\Windows\System32\inetsrv\config then? Dec 3, 2018 at 13:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .