Paul - if you intend to use the FREE DB2connect client - You CANNOT install the DB2 server product on the same machine - that is why you will get the license error. You must delete ALL DB2 software and install only the DB2connect software.
=-=-=-=-=-=-=-=-=-=-=-=-=-=
Here is an install tutorial for the DB2 part
Note: I made the AS400 user account/login to match the db2inst1 user on the linux machine.
Thanks to: Derek Piper for this info.
IBM AS/400 DB2 Connect to Linux Apache/PHP
Install DB2 Connect Personal (or Enterprise) Edition on Linux WWW machine.
Compile PHP with DB2 Support (for appropriate version - the example given is for version 7.1).
Add this option to your PHP compile options
--with-ibm-db2=/usr/IBMdb2/7.1/include/
Create DB2 Instance on Linux machine. Use the 'db2setup' command in the 'install' subdirectory of the DB2 Connect installation. Set up the account but not with the given defaults, pick an original password at least.
user db2as400
password ?????
Set up a user on the AS/400 and keep username and password for later to use in place of [as400user] and [as400pass]. Set that user's CCSID to '037' (for USA), do not leave it at 65535 (possibly system default). Make sure permissions are correct for any tables that need to be read or written to.
Configure DB2 Instance by logging into Linux machine as DB2 user and password (as defined above) (or by su'ing from root to db2 account). Use command 'db2' to enter command line processor. From there, type (on one line per statement):
Items in [] are the user definable settings - don't include the [], just make up different names that are unique based on what is required.
Variables:
[localName] The local name you want to call this instance
[as400Addr] IP Address of your AS/400
[youras400DB] Regular host name of your AS/400
[as400DB] What you want to call the AS/400 on the DB2/Linux side
[DSN] What you plan to have as the ODBC DSN within PHP
[as400user] User with adequate permissions and CCSID*
[as400pass] Password of user
- CCSID is for character handling, you might want to set this to 037 for [as400user] and use the command below with BIDI in. Incorrect settings on eithe end can mean you can't log in even if the password is correct.
Commands (enter step-by-step on one line):
catalog tcpip node asnode remote 209.27.120.134 server 446
catalog tcpip node [localName] remote [as400Addr] server 446 remote instance [youras400] system www ostype OS400
catalog dcs database [as400DB] as [youras400] parms ",,,,,,,,BIDI=037"
catalog database [as400DB] as [DSN] at node [localName] authentication DCS
connect to [DSN] user [as400user] using [as400pass]
bind /usr/IBMdb2/V7.1/bnd/@ddcs400.lst BLOCKING ALL SQLERROR CONTINUE MESSAGES DDCS400.MGS GRANT PUBLIC
connect reset
terminate