Ingrédients : PHP, DB2 et unixODBC

Un de mes projets à mon nouveau boulot à Rome est le développement d’une application en PHP qui travaille avec une base de données DB2 sur AS/400. Je travaille avec des bases de données – principalement MySQL – en PHP depuis pas mal d’années maintenant, mais c’est ma première expérience avec DB2, le challenge était intéressant.

J’ai fait pas mal de recherches avant de commencer, et il semble qu’il y ait principalement 2 façons pour utiliser DB2 en PHP : 1. installer un client IBM DB2 sur la machine où PHP est installé et compiler l’extension ibm_db2 extension. 2. utiliser DB2 avec ODBC et le pilote unixODBC. Cet article utilise cette seconde solution et explique comment installer unixODBC pour travailler avec la base de données de l’AS/400 DB2 avec une machine Linux (CentOS).

Continue reading « Ingrédients : PHP, DB2 et unixODBC »

Ingredients : PHP, DB2 and unixODBC

In this post, we are going to do a recipe mixing those few ingredients: PHP, DB2 and unixODBC.

One of the project in my new job in Rome is to develop an application in PHP that works with an AS/400 DB2 database. I’ve been working with PHP and databases such as MySQL for quite some years now, instead, it has been my first encounter with DB2, so the challenge was interesting.

I did some search before even starting anything, and it seems there is mainly 2 ways of using DB2 with PHP : 1. install a IBM DB2 client on the computer where PHP is and build the ibm_db2 extension. 2. use DB2 with ODBC and the unixODBC drivers. This article explains how to make unixODBC to work with an AS/400 DB2 database on a Linux (CentOS) machine to access it with PHP.

Continue reading « Ingredients : PHP, DB2 and unixODBC »