Installing PHP

Installing the latest version of PHP on your Windows ME PC or Win32 machine is not that complicated.

With PHP 4.2.1 (and some earlier versions), you now have the choice to set up PHP to run as a CGI or as a Server Module with the Apache Web Server.

I have always set PHP up to run as CGI on my Windows machine with previous versions of the software but I thought I'd give the Server Module a try this time (it was being recommended as the better choice in the PHP documentation).

Installing PHP on Windows ME / Win32

First, you have to download the latest version of PHP from here. I always download the zipped binary files.

Unzip the contents of the downloaded file to:
path: c:\php

Then, copy the file php4ts.dll to:
path: c:\windows\system

Next, copy the file php.ini-recommended to:
path: c:\windows

and rename the file to php.ini

Editing PHP.INI file

Open your php.ini file and look for

code:
;include_path = ".;c:\php\includes"

and edit the line like so (note the removal of the semi-colon)

code:
include_path = ".;c:\;c:\php;c:\php\pear"

save and close the file.

Important
Not making the changes mentioned above will result in errors like this:

  • Blank Page
  • Warning: Failed opening '/home/desilva/public_html/index.php' for inclusion (include_path='.;c:\php4\pear') in Unknown on line 0

Editing Apache Web Server's HTTPD.CONF file

Open your httpd.conf file that you will find in:
path: c:\Program Files\Apache Group\Apache\conf\

and look for this line,

code:
# LoadModule foo_module modules/mod_foo.so

inserting the following line on top of it, like so:

code:
LoadModule php4_module c:/php/sapi/php4apache.dll
# LoadModule foo_module modules/mod_foo.so

Now, look for the following line further down the same file

code:
ClearModuleList

and add the following line below it.

code:
ClearModuleList
AddModule mod_php4.c

Finally, yet further down, look for this line,

code:
#AddType application/x-httpd-php .php

and simply 'uncomment it' by removing the hash (#) sign.

code:
AddType application/x-httpd-php .php

Save httpd.conf with the changes you just made and just to be certain, restart your PC and as soon as you run Apache the next time around, you will see that it runs with PHP as a Server Module!

TOP

Do you find it easy to navigate through this site?

 Yes

 No

 Where am I?