dev server: installing php
after installing and testing apache, its time to install php. this time its a bit messy because i’m going for the manual install rather than the windows installer. in otherwords, don’t expect pictures.
note: the following instructions are for running php 4.4.4 with apache 1.3.37 on win32 only. other packages combinations will have a different set of installation instructions.
- download the php 4.4.4 zip package from php.net
- extract to d:\ with subdirectories enabled; i extracted in d:\ and renamed the main subdirectory from d:\php-4.4.4-win32 to d:\php.
- read the install.txt file. the detailed instructions are there on how to install php in different operating environments and with different web servers.
- to make things easier, add the php subdirectory (d:\php) to the path environment variable so the system can easily find it. do this whether the cgi, the command line interface or the sapi module is going to be used.
- move the contents of the d:\php\dlls and d:\php\sapi subdirectories to the main php subdirectory d:\php.
- copy the php.ini-recommended file to where the apache binary is located and rename it to php.ini
- if you are using include files, add the full path name to the paths and directories section of php.ini.
- modify the apache configuration file (httpd.conf) to load the php4 module and recognize php pages when apache starts
at the end of the loadmodule section add:
LoadModule php4_module “d:/php/php4apache.dll”
at the the end of the addmodule section:
AddModule mod_php4.c
add the following line inside the first ifmodule mod_mime.c conditional brace (i found there were two)
AddType application/x-httpd-php .php
modify the directoryindex entry to look like the following:
DirectoryIndex index.html index.php
do not forget to restart apache after applying the changes above.
