Alan Seiden is the expert when it comes to PHP on iSeries. I’ve had the pleasure of working with him. Here’s a slide on the different options to connect to DB2 from PHP and best practices (http://www.alanseiden.com/presentation%20slides/DB2-and-PHP-best-practices-on-IBM-i.pdf). If you’re working with the PHP directly on the machine then you should be using db2_connect or db2_pconnect as it has the most DB2 specific features. If you want to connect from Linux, things are pretty complicated, but it’s possible and if you want the full db2 features you’ll need to purchase a license for DB2 Connect. Have a look at the slides.