Well, I did it...
After reading all that linux documentation, xp is a snap.
I installed php manually in xp using the instructions on the php site. No need to worry about "--with-ibm-db2" or anything.
apache/conf/httpd.conf needs
[FONT=courier new]ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe" [/FONT]
added to the bottom.
c:\windows\php.ini needs
[FONT=courier new]doc_root[/FONT]
changed to
[FONT=courier new]doc_root = "c:\program files\apache group\apache2\htdocs"[/FONT]
Download DB2 Personal Developer Edition from IBM. This package includes DB2 Connect Personal Edition v8.1 - the only element that you need to install on your apache machine.
Run Configuration Assistant. Under "Selected", click Add a Database. Fill in the details of your DB2 server. The port should be 446. I found [URL=ftp://ftp.software.ibm.com/ps/products/db2/info/vr8/pdf/letter/db2c6e80.pdf]this (go to Ch.11)[/URL] to be lots of help, especially the DSPRDBDIRE command!
note - you need to have administrative/poweruser rights on both your Windows network and IBM server.
When Config Assistant can successfully connect using ODBC, go to Start > Programs > Administrative Tools > Data Sources (ODBC). Your db connection should be listed under System DSN. Double click on it, and click on Bind CLI/ODBC Support Utilities. WAIT for a result box to appear. It took my machine a minute or so.
Now you should be ready to go!
In apache/htdocs/myconnect.php put:
[FONT=courier new]
$cur = SQL_CUR_USE_ODBC;
$connect = odbc_connect($dbname, $user, $pwd, $cur);
// where $dbname is the one from the DSPRDBDIRE command
$query = "SELECT * FROM AS400LIBRARYNAME.TABLENAME";
$result = odbc_exec($connect, $query);
[do stuff here]
odbc_close($connect);
[/FONT]
then go to http://localhost:8080/myconnect.php (or whatever port apache's listening on - mine's 8080.)
🆒