PHP on IBM’s System-i
Friday, June 8th, 2007
Some of the developers at Ibuildings are working with PHP on IBM's System-i platform. If that name doesn't ring a bell, it has been called 'iSeries' for a while and it's basically a new name for the old AS/400. If you're old enough to remember Happy Days you probably remember those nifty 'green screens' that they used to use in stores, banks etc. There's a 90% chance that these green screen applications were running on AS/400.
The green screens have mostly made way for more modern interfaces, but the servers that run them still exist today. Many of the applications on them have been modernized by adding a web-interface to the existing applications.
There are several ways to make a web interface for green screen applications, or 'RPG programs', as System-i developers call them; RPG is the programming language that they traditionally use on those machines, and it is complete abacadabra to most PHP developers.
For a while now it is possible to use Java to make webinterfaces on System-i, and there are several cgi based tools. And recently IBM and Zend have teamed up to port PHP to the i5/OS operating system. So far this port seems succesful; one of the reasons is perhaps that PHP is easier to adopt by traditional System-i developers than Java, which forces you to learn Object Oriented Programming. In PHP you can do OOP, but you don't have to. You don't even have to use functions, and this is a lot closer to classic System-i languages (although I would of course recommend any System-i developer moving to PHP to learn at least about procedural programming).
When running PHP apps on System-i, you can use the standard db2 database extension to access the db2 database, but alternatively you can also use the 'i5 toolkit' that is available in PHP on i5/OS. There are some subtle differences, and if you find yourself having to write PHP applications for System-i, it's good to know about how to use the i5 toolkit to use the db2 database. Harrie Verveer has written an article on this topic on our company blog. It explains one of the differences between the db2_* and i5_* functions, but it contains some sample code and as such is a nice example of how to use the i5 functions.


