|
PHP is Almost Certainly Coming to the iSeries
by Timothy Prickett Morgan
The iSeries is best known for running RPG and COBOL applications. It can also run Java applications (and do so as well as any other platform) and myriad kinds of middleware to display those RPG, COBOL, and Java applications on various screens and interfaces. But the iSeries may be getting a new programming language: PHP, which is short for Hypertext Preprocessor.
You might wonder why there is a P on the front end of PHP. Some people argue that PHP is short for Perl Hypertext Preprocessor, because the antecedent of PHP was a collection of Perl scripts made by programmer Rasmus Lerdorf, a Danish nerd who in 1995 made those Perl scripts to automate certain aspects of a Web site. (Lerdorf is now an infrastructure engineer at Yahoo, so if you think that donating to the open source community doesn't help your career, you are wrong.) Some say the PHP acronym is self-referential and recursive, in deference to Richard Stallman, the father of open source software who created the GNU: Not Unix (GNU) license. (That would mean PHP is short for PHP: Hypertext Preprocessor.) But the fact is, the original programs created by Lerdorf were called Personal Home Page/Form Interpreter (PHP/FI), and that is where the PHP came from. The new name is a retrofit on an old acronym.
Just like Linux was born from the frustration that Linus Torvalds had with expensive X86-based Unix operating systems, PHP/FI was born because writing and maintaining Perl-based scripts that were behind dynamic Web sites in the mid-1990s was a pain in the neck. Perl is short for Practical Extraction and Reporting Language, and that name shows that Larry Wall, Perl's creator, has a sense of humor. (So does the fact that Perl is not an upper case acronym, as it should be based on computer industry practice, but these open source programmers, like IBM marketeers, are such renegades when it comes to acronyms.) Perl is an open source scripting language, and while it is very useful, the fact remains that it is a bear and a half to create and maintain Perl scripts to do Common Gateway Interface (CGI) programming. PHP/FI had an HTML parser that could scan for PHP commands embedded in the HTML code. The PHP commands might grab snippets of HTML and merge them into a single HTML document, for instance. While PHP/FI processed those embedded commands in conjunction with the Web server on the server side, as far as a Web browser was concerned, all it was fed was standard HTML.
By the way, IBM has long since allowed OS/400 shops to use RPG as a CGI scripting language, which controls how different applications embodied in a Web-based application talk to each other as they are driven by end users sitting at Web browsers; IBM has sort of supported Perl for CGI scripts--software change management and development tool maker MKS ported Perl to OS/400 several years ago--but IBM has not itself done an official port of it to OS/400.
In late 1997, Lerdorf did a rewrite of the open source PHP/FI tools, and soon thereafter Zeev Suraski, a programmer working for Israeli Internet service provider Netvision and an instructor at Technion University, and Andi Gutmans, one of his students, found PHP/FI and decided that the scripting language and parser at the heart of this PHP/FI language needed a complete rewrite. They worked with Lerdorf to completely rewrite the code. The resulting code, called PHP 3, was released in June 1998, and at that time, some 50,000 Internet domains were using PHP/FI to drive at least some portion of their Web sites. PHP 3 soon broke through the million domain barrier because it was a radically improved language. By the end of the year, the two decided the parsing engine still needed a lot of work, and they set about to create PHP 4 and a new engine, which they called Zend (short for Zeev and And, presumably because ZeAn looked stupid). It took three and a half years to get PHP 4 out the door in May 2002, and it now has an installed base of 15 million domains using it to drive Web sites. PHP 5, which was announced in July 2004, was the result of two years of work by the PHP community to redo the Zend Engine once again, adding many object-oriented features, extending XML support, and putting in support for Web services architectures; but PHP 5 also removed some other features, and as you might guess, this has created some heated debates. PHP 5 also included a new module called MySQLi, which hooks into and takes full advantage of the latest MySQL 4.1 open source database; it also has an embedded SQL database so developers can code on their workstations and not have to be linked into the development or production servers that will ultimately run the PHP code. There are some compatibility issues between PHP 4 and PHP 5, and that is why a lot of people have chosen--thus far--to stay with PHP 4.
So that is, in a nutshell, what PHP is.
Now, I know what you are thinking. If there is one thing the iSeries programmer community really wants to learn, it is another language. (That was sarcasm, obviously.) And I know we all heard from IBM, Sun Microsystems, and others about how Java was going to lead us all into the Promised Land, where milk and money flow freely. (Well, something like that, anyway.) The fact remains that whether you need it or not, PHP might soon be part of the iSeries culture, and it could turn out to be one of the saviors of the iSeries platform.
The reason is sheer numbers. There are maybe 500,000 to 700,000 RPG and COBOL programmers in the OS/400 world, and about 3 million Java programmers across all platforms. No one has any good estimates for how many PHP programmers there are in the world, but with 18.5 million domains running PHP, there are easily many hundreds of thousands to several millions of people with some working knowledge of PHP and probably several hundreds of thousands to a few million programmers with hard-core PHP skills. Moreover, there is a wealth of blog, forums, content management, and other Web application software available under open source licenses written for PHP--many of which also have affordable commercial support options.
Another reason that PHP might catch on is performance. Friendster, the social networking Web site, kicked out Java Server Pages for its site and migrated to PHP because of performance issues. PHP has cache accelerators and is just plain faster than Java for many Web applications. To oversimplify, if you write an application in Java, that application will require many Java Virtual Machines and it will require those JVMs to talk to each other. With PHP, the HTML pages that are generated by the PHP engine can be cached once someone accesses them and, equally importantly, PHP can call highly-tuned C or C++ (or RPG or COBOL if PHP goes native on the iSeries) routines that are more efficient than Java code at doing the same job. Moreover, the scalability of PHP is more directly related to the scalability of the underlying databases it accesses, which is good news for the iSeries. DB2/400 is no slouch when it comes to scalability. Having said that, other people claim the real performance problem with Friendster was that they used the open source Tomcat application server to serve up Java pages, or that their JSP programming model was the real issue and the move to PHP was totally unnecessary. Who knows what the truth is? (Probably something like this: Good programming in just about any language is better than bad programming in a great language.)
About a month ago, IBM saw the light on the PHP development language for Web applications, after realizing about 40 percent of the Web programming tools sold today are based on PHP, not Java or .NET. To that end, IBM has signed a partnership with Zend Technologies, the company that Suraksi and Gutmans founded in 1999 to commercialize the PHP products they have created.
IBM is throwing in the "Derby" open source variant of its Cloudscape database into the Zend partnership. Derby was previously donated to the Apache Software Foundation and will now be married with Zend's PHP tools to create an integrated Web application environment that will be supported commercially by Zend. The two companies will also eventually support DB2 as a back-end database with a commercial product. Presumably that back-end support will include hooks into the DB2/400 integrated database within the i5/OS operating system. IBM has also launched PHP informational areas on its developerWorks site, which has 4.5 million registered users.
Because of the growing popularity of PHP for certain kinds of Web development, everybody is asking IBM Rochester when we can expect to see PHP go native. While the open source PHP and the commercial extension products from Zend are available on Linux (including the raw open source Linux as well as commercial distributions from Red Hat, Novell, Mandrakesoft, and Debian), Windows (NT 4.0, 2000, and 2003), and Unix (Solaris and FreeBSD). PHP will, in theory, run on any Unix platform, but the practice is a bit more difficult. The fact is, if Zend is not offering support for the AIX and HP-UX versions of Unix or for OS/400, then commercial customers are probably not interested. And because PHP is not yet officially supported on AIX, running it inside OS/400's PASE AIX runtime environment is a pretty risky idea for commercial applications. But if you really want to do it, you can. IBM has put out a set of instructions for loading the open source PHP engine into PASE on its Redpaper Web site. If you want to use PHP and have technical support from IBM or Zend, you need to install it on a Linux partition and compile it for the Power architecture or install it on an Integrated xSeries Server running Linux or Windows.
Sources at IBM say they are looking into the IP issues of porting PHP properly to OS/400 and AIX, and, without making any commitments, they say it is a growing requirement for the iSeries and PHP will be ported to OS/400 long before the Perl development tools or the JBoss Web application server. "We are looking into PHP," Jim Herring, director of iSeries product management and business operations, told me recently. "We know there is a requirement for it, and we know we have to get a simplified, easier programming environment for the Web for the iSeries."
That means an alternative to the Linux-Apache-MySQL-Perl/Python/PHP stack--commonly referred to as LAMP in the open source community--might be coming to the iSeries. If it does indeed go native on the iSeries on top of OS/400, I even have the acronym ready: WiPD, which is short for WebSphere-i5/OS-PHP-DB2/400. Pronounced "whipped," I suppose. And like so many acronyms in this business, it wouldn't really mean what it sounds like.
|