How to Enable PHP on IIS 6.0

How to Enable PHP on IIS 6.0 thumbnail
Setting up a Windows server to work with PHP can be complicated.

PHP (PHP: Hypertext Preprocessor) is a free programming language used primarily on Apache web servers to deliver web pages to client computers over the Internet. IIS is a package of server applications developed by Microsoft as an alternative to Apache, which usually runs on non-Windows machines. While PHP was developed to work on computers running Linux, it has been modified to work with Windows computers, including those running IIS 6.0. This guide assumes that you have a computer running Windows XP or Server 2003 with IIS 6.0 and some version of PHP already installed.

Things You'll Need

  • Computer
  • Text editor
  • Web browser
Show More

Instructions

  1. PHP configuration

    • 1

      Open the file of PHP's startup directives. These are the options PHP initializes when it starts. The directives will be contained in a file called php.ini, which you will need to set up. You can use the default settings as a template by copying and renaming the file called php.ini-distribution.

    • 2

      Open your php.ini file in a text editing program.

    • 3

      Check and/or fill in the directives necessary to run PHP on IIS. Fill in the file path to the extensions directory on the line with the phrase "extension_dir". The file path is usually "C:\PHP\ext," but it may be different depending on where you installed PHP and the extensions folder.

    • 4

      Include the links to the .dll files for the extensions you have installed. Type each link in the following format on a new line under the "extension_dir" line:

      extension = *.dll

      Replace the "*" with the name of the file.

    • 5

      Find the line "log_errors" and set it to "On." Next, include the file path of the directory where you want PHP to save the error logs. The usual file path is C:\inetpub\temp\php-errors.log.

    • 6

      Set up PHP to work with IIS's CGI requests. Find or include the following directives and their corresponding values:

      cgi.force_redirect = 0

      cgi.fix_pathinfo = 1

      fastcgi.impersonate = 1

      fastcgi.logging = 0

    • 7

      Configure other directives as you see fit. If you don't know what you are doing it is best to do some research or just leave the other directives to their default settings.

    • 8

      Save and close php.ini.

    IIS configuration

    • 9

      Navigate to www.iis.net/extensions/fastcgi and download and install the appropriate version of the application. This application will help IIS work with PHP for processing appropriate requests.

    • 10

      Open a command prompt window.

    • 11

      Tell IIS where to route PHP requests. You will need to know the file path of the php-cgi.exe file. It may be located in the root of your PHP installation. Type the following into the command line, replacing the word FILE with the file path of php-cgi.exe:

      cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" ^ -extension:php -path:"FILE"

    • 12

      Close the command prompt window.

Related Searches:

References

Resources

  • Photo Credit Mensch und Computer 5 image by Sven Rausch from Fotolia.com

Comments

You May Also Like

  • How to Setup PHP on IIS 6

    Internet Information Services version 6 (IIS6) allows you to host websites on your computer. IIS6 is a part of older Windows operating...

  • How to Enable IIS

    IIS (Internet Information Services) is a set of services created by Microsoft used primarily for developing websites. The services packaged with IIS...

  • How to Enable SHTML in IIS 6

    Often referred to as SSIs, server-side includes are represented by commented code included in an HTML document. Whenever the page is loaded...

  • How to Enable SSL and PHP

    Without proper security, the Internet wouldn't be as useful as it is. You need encryption to send information such as credit card...

  • How to Run PHP on IIS 6

    PHP is a Web development language used primarily on Apache servers. However, Microsoft's Web hosting software, Internet Information Services, can host the...

  • How to Configure PHP on IIS 6

    PHP is a programming language that allows you to create dynamic web pages. PHP is typically run on an Apache server, but...

  • How to Enable FrontPage Extensions IIS 6

    The Internet Information Services (IIS) package of modules and services allows nearly any Windows-based computer to operate as a Web server. In...

  • How to Set Up an SMTP Server on Windows XP Pro

    SMTP (Simple Mail Transport Protocol) is just that: simple. When you send an email to someone, the email program tells the SMTP...

Related Ads

Featured