Frames Modems Help Home Page Chipsets Search No Frames
Diary Entries See also Site Info & Diary.
18 August 2001 Now adding the PHP4 (Hypertext PreProcessor) application...
  Like Apache itself PHP is produced by the Apache Software Foundation. For production Server environments Apache promotes it's use on UNIX OSs, but for the kind of learning & setup I'm doing Windows is fine. UNIX OSs already contain compilers, so both Apache & PHP are provided in source code which is then compiled to an executable on the target hardware (much more flexible, potentially faster but more work). Microsoft charges for this basic service, so both are provided for the Win32 environment ready-compiled (less flexible but easier).

From my experience of both the PHP folks haven't quite got their act together on the installation front as well as the Apache people. The downloads page provides a basic 755 KB InstallShield executable which seems to contain everything I need. In addition, a 4,859 KB zip file containing all bells & whistles is also available for manual installation.

I used the smaller file & chose defaults throughout. With hindsight I should perhaps have chosen the 'Advanced' option, but Apache would still need to be manually set up. During file copying I was horrified to see MSVCRT. DLL being copied into the System folder - this file is one of many that are notorious for causing system problems, although not on my system so far. It is 289 KB & dated 10 Dec 99 12:00. Sensible programmers leave such files in their own folders & don't compromise the central System folder.

(added 7 Oct - even the large ZIP file doesn't include the manual. This needs to be downloaded separately from the docs downloads page - a ZIP file of 2,345 HTML files is 3,189 KB.)

  The Apache httpd.conf file (in the conf folder) needs configuring next (whilst Apache is NOT running):
  1. DocumentRoot & Directory set to "[website-root-folder]" (but with forward slashes - UNIX convention - eg "C:/Websites/My Website")
  2. "AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps" (no quotes) added to <IfModule mod_mime.c>
  3. ScriptAlias /php/ "c:/php/" (put in the ScriptAlias section to be tidy)
  4. Action application/x-httpd-php "/php/php.exe" (put with other Actions for the same reason)
No 1 is so that putting "http://127.0.0.1" (no quotes) into a browser will bring up the default page in the copy of the website files that are being constructed at C:/Websites/My Website. Nos 2, 3 & 4 are so that PHP is used if a file has a .php file type.
  The final step is to test the installation - nice and easy:
  1. Create a text file containing "<?php phpinfo();?>" (no quotes), call it test.php & put it into C:/Websites/My Website (or whatever yours is called).
  2. Startup Apache
  3. Startup the Browser (I use IE5)
  4. Type in "http://127.0.0.1" (no quotes)
  5. A file listing comes up (no index.html or any other files yet) so click on the test.php file
A couple of glitches for me at first (a blank page, because I hadn't set up the httpd.conf properly) but there it was - the only difficult bit being to write all this stuff.