Avoiding Mistakes With PHP On IBM i Platforms
November 12, 2012 Dan Burger
We all make mistakes. And for those who don’t, I make up for your perfection. There’s value in mistakes. Learning about mistakes is a good way to avoid mistakes. It’s as true with PHP as it is with skydiving. Because a lot of people in the IBM midrange community use PHP, and presumably many more will be learning about it soon, I hope this helps them.
This is not to say people using PHP for Web application development are more likely to make mistakes or that it is easier to make mistakes in this environment. Please don’t jump to that conclusion. The intent is simply to save PHP developers some time and aggravation.
The experts providing the advice in this article are Marcel Sarrasin, product manager at BCD International, an IBM i software vendor, and Alan Seiden, a consultant specializing in PHP and IBM i. As I already mentioned, I’ve made some mistakes every now and again. But picking these two guys to participate in this article wasn’t one of them.
A perfect place to start is with the IBM i on the Power platform. Don’t let the legacy haters undermine the system and existing resources. Everything that needs to be done can be done on this platform and its enterprise-strength database. PHP brings multi-platform capabilities, but it’s an additive. RPG and/or COBOL are the real fuel as long as the applications written in those languages are well structured and well maintained. Throwing away valuable business logic is a mistake. If a company has solid applications, it must also have skilled developers, which makes it worthwhile to stay in that familiar environment. Use PHP to call those programs and make them components in the mix.
IBM i shops that have decided to move forward with PHP as an in-house development strategy should avoid jumping into deep water immediately. “Pick a modest project that would solve a problem,” Seiden says. “Satisfying an executive need is always a good way to gain support. Don’t go at this alone. Get help. PHP has a very loyal community much like IBM i.”
In other words, it’s a common mistake to over promise on the scope or time frame of a project and you are limiting yourself by working outside the community.
A little more in that vein from Seiden: Install Zend Server Community Edition (from Zend Technologies) at no charge to get started. And get a year of free support.
“Be patient. Don’t feel like you need to be a master to begin with. Start simple like with a script on a static HTML page, add PHP logic, and display information. Don’t be concerned about perfection in a first project. Just get some functionality out there and build some confidence,” Seiden advises.
In more advanced scenarios when applications are complex, performance becomes an issue and skills are honed to higher degree, but that doesn’t mean they are mistake free.
Poor coding practices, poor SQL optimization, and poor architecture can contribute to a program that falls short of expectations.
BCD’s Sarrasin offers this list of advice, avoidance techniques, and tips for greater success:
Seiden adds a caution that although PHP is relatively lightweight, a successful public application increases the workload on the system. Plan for adequate IBM i capacity–resources such as CPU and memory–to avoid performance hits. Also take advantage of the performance improvements for DB2 SQL in v7.1. And avoid problems by staying current with releases and PTFs.
When PHP programmers come from outside the IBM i environment, Seiden suggest trouble can beside-stepped by providing training on the i that includes commands and how to use CL, which he calls “the glue for combining PHP and IBM i.” Avoid situations where PHP programmers are dependent on someone to explain every aspect of IBM i operations. A blending of PHP and IBM i staffs, with each gaining knowledge of the other environment is a far better way to get things accomplished.