Run PHP4 on Windows 2000PHP4 b4 comes with instruction in the readme file for setting up under PWS: you add it as a filter, and as a script engine. Heres what I did, In short:
Copy PHP4TS.dll to %SystemRoot%System32
On a fresh install of Win2k the other required dll, msvcrt.dll is allready there and is newer so I wouldn't risk overwriting it :).
Copy PHP.INI-DIST to %SystemRoot%PHP.INI
--> It should work straight out of the box, if you follow the guidelines below.
In Internet Servicices Manager, Expand the server you want, then right click on the WWW site you want PHP to work on: you can do this for more than one site of course.
>From the right click menu, choose Properties.
In the window that comes up, choose the ISAPI Filters tab, click Add...
In the little dialog, tell it the path to PHP4ISAPI.DLL, which will be wherever you unpacked PHP to. (this ONLY applys to version 4.0 and above. There is no ISAPI mode of v3 as far as I know).
Give it the name of PHP.
Once you've done that, and clicked OK, change to the tab "HomeDirectory", Look around the "Application Settings" label. Around that area youwill see a button labelled "Configuration". Click it!
In the window that pops up, click add. In the executable field, tell it where the PHP4ISAPI.dll file is. (if you have v3, and not v4, point it to php.exe at this stage). Tell it what extension to use. PHP or PHTML are common. (You do NOT need the . before the extension). Verbs: All Verbs. Script Engine: Yes. Check that file exsists: Up to you, I guess. Will either let IIS generate the 404, or PHP give users a "No Input File Specified".... I urge youchoose yes :) Click ok. You will need to repeat this step for each file extension you want PHP to work with!
You then need to completely stop IIS. You can do this by "net stopiissvc" from the command prompt (under win2k I get this by running cmd.exe).
>From the command prompt type "net start w3svc". Now return to Internet Services Manager, and start each of the services again.
Now make a page like page.php in the root of your site (of course replace the .php with an extension that setup to work with PHP!), and just put something simple like <? echo($HTTP_USER_AGENT); ?> In the file. This also tells you what you are telling every site you visit :).
This is a bit more wordy than the PHP readme, but hey it worked on IIS5/WIN2k, and IIS4/WinNT4Server.
Hope this assists :) Patick. |