2

is there a way to setup windows server 2003 IIS so that PHP code can be included in HTML and HTM documents?

4 Answers 4

2

set up PHP on IIS as normal and then map .htm/html isapi extension to use PHP executable. To do this, first right-click on "Web Sites" in the left-hand menu and select "Properties". Here you can change your ISAPI extensions. Find the htm and html extensions and change executable to the same as .php-extension.

Sign up to request clarification or add additional context in comments.

2 Comments

I have a follow up here.. after reaching 'Properties' I can't go any further, I have 10 tabs and there is one ISAPI-Filter but here I don't see any PHP at all.. I have it in German maybe I need to look deeper but could you tell me the name of the tab in english perhaps than I can translate it in German and try to look for it!
the tab is named Mappings (in english)
1

Steps to Install PHP on IIS

  1. Open your browser to PHP for IIS Windows Download Page and download the PHP non-thread-safe zip package.
  2. Download the WinCache extension from the List of Windows Extensions for PHP.
  3. Extract all files in the PHP .zip package to a folder of your choice, for example C:\PHP.
  4. Extract the WinCache .zip package to the PHP extensions folder (\ext), for example C:\PHP\ext. The WinCache .zip package contains one file (Php_wincache.dll).
  5. Open Control Panel, click System and Security, click System, and then click Advanced system settings.
  6. In the System Properties window, select the Advanced tab, and then click Environment Variables.
  7. Under System variables, select Path, and then click Edit.
  8. Add the path to your PHP installation folder to the end of the Variable value, for example; C:\PHP. Click OK.
  9. Open IIS Manager, select the hostname of your computer in the Connections panel, and then double-click Handler Mappings.
  10. In the Action panel, click Add Module Mapping.
  11. In Request path, type *.php.
  12. From the Module menu, select FastCgiModule.If you don't find CGI Module follow the below steps. How to Enable FastCgiModule? Step 1: Go to Control Panel\Programs\Programs and Features and click on Turn windows features on or off Step 2: Go to Internet Information services\World Wide Web Services\Application Development Features check/enable the CGI and press okay to apply the changes. Step 3:After enabling FASTCGI module IIS server should be restarted. enter image description here
  13. In the Executable box, type the full path to Php-cgi.exe, for exampleC:\PHP\Php-cgi.exe.
  14. In Name, type a name for the module mapping, for example FastCGI.
  15. Click OK.
  16. Select the hostname of your computer in the Connections panel, and double-click Default Document.
  17. In the Action panel, click Add. Type Index.php in the Name box, and then click OK.
  18. Click Add again. Type Default.php in the Name box, and then click OK. enter image description here enter image description here
  19. After adding IIS server should be restarted.

To test your PHP installation 1. Open a text editor, for example Notepad, as Administrator. 2. In a new file, type the following text: 3. Save the file asC:\inetpub\wwwroot\Phpinfo.php. 4. Open a browser and enter the following URL: http://localhost/phpinfo.php

Comments

1

Yes. You have to add isapi.dll plugin from php distrib. You do that in properties window for your website

Comments

1

The best way to install PHP for IIS is via Web PI. It is guaranteed that you will get the latest PHP installer supported by IIS and that it does the right configuration.

Then, to configure your PHP installation with IIS7+ in the simplest way, you can use PHP Manager. Here is a walkthrough on how to use it (also very intuitive). Finally, PHP Manager can easily help you manage and switch between different PHP installations, detect errors or inconsistency in PHP configuration.

1 Comment

Thank you very much for this info.. I wish I had time to redo it. but I simply don't have the time to reinstall windows

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.