Please excuse the simplicity of this question, but it has happened to many people just starting in PHP work. Are you loading your PHP file into your webbrowser using a URL like
http://localhost/path/to/yourscript
in effect going through PWS to retrieve the file, or are you loading the file directly off your HD using the File | Open... feature in most browsers? This method will not result in the PHP engine being called, as you must go through your webserver to receive the file.
Silly, I know, but just thought I'd ask.
As for help on installing PHP4, the ReadMe.txt that comes with PHP seems pretty simple, though I must admit the information on installing it for PWS is a tad weak. So basically, here's a short list on how to install PHP4 on Win9x running PWS, assuming you downloaded the .ZIP file:
Decompress the .ZIP file to a directory of your choice (we'll assume C:\PHP is where the files are placed for these instructions).
From the decompressed file location, move MSVCRT.DLL and PHP4TS.DLL to C:\WINDOWS\SYSTEM.
Again from the decompressed file location, copy PHP.INI-DIST to PHP.INI, then move PHP.INI to C:\WINDOWS.
Modify PHP.INI so that the information contained in it reflects your environment. This will require reading through the PHP.INI file and learning what the various parameters mean, but for starters find and modify the following:
doc_root = "C:<directory where your webroot is>"
extension_dir = "C:\PHP"
[Sorry, but not sure where PWS defaults to looking for its web documents.]
Later, as you become more familiar with PHP, be sure to go back to PHP.INI and look at sections such as
[mail function]
...
[Sessions]
...
and modify them accordingly so that you can start using some of the cooler features in PHP.
- One more time in the decompressed file location, right-click on the PWS-php4.reg file, choose EDIT from the popup menu, then modify
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
".php"="[PUT PATH HERE]\php4isapi.dll"
by replacing [PUT PATH HERE] with the path to where you decompressed the PHP files. And be SURE to use TWO (2) backslashes wherever one is in your path. Using the path we established in the instructions, the line should now read
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
".php"="C:\PHP\php4isapi.dll"
Be sure to save this change.
Double-click on PWS-php4.reg to add this registry entry to your Windows registry.
In the PWS Manager, right click on a given directory you want to add PHP support to, and select Properties. Check the 'Execute' checkbox, and confirm.
Please note these instructions just get you up and running. To really tap the power of PHP, you need to learn what the various parameters in PHP.INI do for you. And before doing session management, be sure to modify the [Sessions] section of PHP.INI.
Hopefully that'll get you started right. Good luck.