
A few days ago, I set up WAPP (Windows + Apache + PHP + Postgresql) on my workstation. As much as I’d prefer working in a Linux box for systems development, I simply have no choice as I’m on a tight schedule (less than 20 days) to produce a working prototype. For that reason, I’m compelled to use Macromedia Dreamweaver MX 2004, hence the switch to Windows.
Initially, I expected to get everything up by a few hours. Instead, it took me almost two days before I was able to finally get something useful done. Unexpected behavior and lousy documentation from new binaries had me figuring out why some things never worked out on the new set-up.
For those trying to set-up WAPP on their workstations or servers (with the latest binary versions, that is), here are some notes to make your set up painless:
Postgresql 8.0 - Needs an NTFS partition for its data directory. If you are running on a FAT32 partition, you can convert your drive to NTFS by running this command:
convert /fs:ntfs
Apache (1.3.33) and PHP (4.3.11) - Apache by itself gives no problems, it’s when you try to attach the PHP module that things start to break. Below are the steps I used to make both of them run:
1. Add your PHP directory (usually C:\php) to the system path. For this, I make an autoexec.bat file and put the line:
SET PATH=%PATH%;C:\Php
By adding C:\Php to your system path, Windows can now find the php4ts.dll without you having to copy it into the C:\Windows\System32 directory. This is the recommended procedure as stated in the new install.txt file as it makes upgrading to newer PHP versions easier since you would only have to worry about a single directory.
2. Edit apache’s httpd.conf file (C:\Program Files\Apache Group\Apache\conf\httpd.conf) and add the following lines:
# Add to the end of the LoadModule section
LoadModule php4_module "C:/php/sapi/php4apache.dll"
Use the line above instead of the one stated in the install.txt file. php4apache.dll is located under the “sapi” directory and not in “C:/php.” That is a bug on the official PHP documentation.
# Add to the end of the AddModule section
AddModule mod_php4.c
# Add this line inside the conditional brace
AddType application/x-httpd-php .php
# For syntax highlighted .phps files, also add
AddType application/x-httpd-php-source .phps
3. Run apache by typing “apache -k start” on the command prompt. For some strange reason, Apache with PHP does not start when you start it from the Services menu or by typing “net start apache” on the commandline.
To make things more convenient, you can make a desktop icon of the apache binary so you can start it easily. Once started, there is a command-prompt window that stays opened. To shutdown apache, just focus that box and type Ctrl-C.