Thursday, October 7, 2010

Configure IIS so it can run PHP scripts (on development machine)

  1. Your server roles is as an Application Server
  2. Install FastCGI from http://www.iis.net/expand/fastcgi (I’m using the latest release version and not the 1.5 RC)
  3.  Install PHP for Windows, which you can get at  http://windows.php.net/download (currently version 5.3.1). You may select the ‘non-thread safe version’, as recommended by http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60 (section entitled ‘Download and Install PHP’)
  4.  Select ‘IIS FastCGI’ and it will associate the FastCGI ISAPI filter with IIS , meaning you can skip the section ‘Configuring FastCGI Extension to Work with PHP’ on the iis link above.
  5. To test PHP has been installed successful, create a folder and add a file index.php to it (e.g. put the file under C:\phpwebs\phpinfo with the  the following code in it:
    1. <?php phpinfo(); ?>
    • Then go into the IIS Manager in administrative tools, and under Websites/Default Web Site, create a new virtual directory. Give it a name (e.g. phpinfo) and select the folder you created, ticking Read and Execute permissions.
    • Open up a browser and navigate to http://localhost/phpinfo. You should see the classic PHPInfo screen with the Server API down as CGI/FastCGI.

No comments:

Post a Comment