Friday, January 7, 2011

Patches? We don need no Stinkin' Patches!

Well, if you are familiar with that famous scene from the “Treasure of the Sierra Madre” you probably have an idea where I am going…

I am having a little fun here with my reference to this classic film and the recent PHP hotfix that was developed to address a processor exploit. The truth is that all systems need patches sooner or later. Some operating systems need them more than others and release them on a weekly basis. Others batch them up and say come and get them when you are ready. But as we know, on the IBM i things are a little bit different.

First, let’s explore what happened. On the Zend website you can read an article that describes the issue. Essentially there was a flaw in the floating point conversion of the Zend Engine that when running on some processors that could cause a site to seize up. As an organization, Zend R&D and several other groups within the company jumped in and deployed the patch in a mere 24 hours from the point of diagnosis. Not bad if you are looking for enterprise support for PHP, I’d say. Here is the important thing, who was exposed? This article goes on to talk about the architectures that were not impacted. Those include Intel 64-bit Linux, MAC OSX and IBM i. So why was IBM i safe? Simply put, Power PC!

People who get embroiled in the religious wars over platforms tend to lose sight of the significant value proposition that we enjoy simply because we run on another processor. Does that mean the PowerPC is without flaws? Hardly. But it does mean that we enjoy a little security through obscurity. Hackers and exploiters are simply not attacking PowerPC. Why? Well probably for the same reason you don’t see too much in the trade press about it. Power PC is powering the Power systems at IBM and some game station like Wii, Xbox, PS3/PS4, etc. so the folks who have a Power System are using it for business, and the gamers are hacking their boxes to load Linux on a 64-bit architecture. Woohoo! We’re safe on this one!

But, enjoying the wonderful safety of IBM i does not mean we should sit back and expect that “Murphy” will never come knocking. The reality is that the IBM i has one of the best “patching” processes in the industry and the fact that most IBM i developers have no clue about it lends itself to significant credibility as most of you simply do not HAVE to know about it. So after talking to so many of you I figured I summarize some of the recent discussion point about PTF’s and Zend as a bit of a refresher. For an in depth discussion on PTF strategy, I would highly recommend Larry “Dr. Franken” Bolhuis' presentation “Managing IBM i PTF’s” at COMMON or a local user group near you! Here are two slides he donated to this blog for your consideration!






First, a refresher on how and where Zend Server runs on IBM i. There are two major worlds that comprise the IBM i Zend Server universe. The first is the IBM HTTP Server Powered by Apache and the second is PASE (Portable Application Solution Environment). Ideally your system manager should have a strategy in place for keeping current with Cumulative and Group PTF’s. If that is the case then you should be good to go. If not, get some religion NOW and some help if you need it. Either way, please read on!

Starting with the Apache server I would direct your attention to the group PTF for HTTP for your respective OS version. It is easy to determine where you are on this food chain as IBM has created a one stop shop to see your current status. Simply run the WRKPTFGRP command from the green screen and press F11 to see the descriptions for the group PTF’s that are currently installed. If, per chance, you run the command and see nothing, there is a very good possibility that you have no group or cumulative PTF’s installed or applied. Need I say more to you about that? I think not. If you have groups installed you should be able to navigate around the screen to see the current level. Find that current level and then head to the IBM website for Fix Central. This page contains a VERY valuable link for current group PTF levels. Compare your level to the IBM level to get a “feel” for how far off you are.

I am pleased that most of my customers tell me they are either current or only a level or two behind. Every once in a while, though, I get someone who cannot install Zend Server and when I ask about their PTF levels they will respond “What’s a PTF?” I walk them through the steps identified above and we discover a lot!

So why do I need PTF’s to implement Zend Server on IBM i? Well, the word “need” is a relative term. When Zend revised the stack from Zend Core to Zend Server on IBM i, several changes were implemented to address a number of customer requirements. Most notable was the dual Apache configuration of Zend Core. To achieve a better performance model and reduce the Apache servers to a manageable ONE, IBM and Zend collaborated on delivering Fast CGI as a method for deploying PHP on IBM i. FastCGI is an open source approach to work with Apache servers and since IBM essentially OWNS the Apache server on IBM i, they have graciously built and provided the FastCGI infrastructure with significant contributions from Zend. IBM implemented these changes as part of the base for i7.1 and via PTF’s for V5R4 and i6.1 as well as the interim releases.

Any company that implements new technology is going to have an aggressive update process. IBM is no stranger to this phenomenon so in order to ensure that you have the latest and greatest fixes and features for FastCGI you should keep current with the group for HTTP as well as your Cumulative PTF package and PASE.

Tuesday, December 14, 2010

If you think education is expensive, try ignorance!


Usually, I try to write about education in September. I missed that point so now it’s time to make up some ground and look back at 2010 and forward to 2011…


The title of this piece is probably one of my favorite bumper stickers. I have a soft spot for people learning a new technology. I for one know it is not easy as I had to battle my own complacency and really dig in to Linux based solutions this year. I still have a way to go but gaining ground! As a young veteran in the IT industry I found it hard to prioritize and focus. there is no forgiveness in the number of distractions we must contend with today. I have the unbelievable privilege of working with some of the smartest people on the planet and their patience has been a blessing. But this experience makes me realize every day the value proposition of PHP in the IBM i space and would not trade this job for the world!

2010 was a wonderful year. I have been VERY privileged and honored to present several PHP sessions at user groups across the country and even in Europe! But I also had the chance to present a bunch of sessions at both COMMON events, too. I’m going to take a brief look at where we all went in 2010 and try to prognosticate on where 2011 is headed.

The year started off well with the beta announcement of Zend Server for IBM i followed by the GA release in April and a West coast tour of user groups including PMSA, Cascade and Power SURG. Spring gave way to the annual COMMON Meeting and Expo in Orlando, a WAM East Coast tour (after a snow delay) and the traditional trek to the WMCPA conference. With the summer trip to MITEC and Irvine for the OCEAN conference under my belt I got caught up on LPAR’s and updates as I prepared for the fall events in San Antonio for COMMON, Omni and a trip to Ireland & England. I made some wonderful new friends at the Manchester event for Penton and at IBM’s South Bank in London. The highlight of the trip, however, was meeting the UK arm of the Zend Sales team who work in an office space leased inside the Guinness Brewery. What a hoot! Last week I saw the fine folks in St. Louis and talked PHP all day with hardly anyone running out of the room!

In my spare time I have tried to keep up with my family and the most aggressive schedule imaginable. My wife is the most awesome quarterback keeping us all moving the ball forward and I would be lost without her! But also I managed to teach a couple of classes in PHP at Moraine Valley Community College and for SystemiNetwork. Two things I plan to carry forward in 2011.
But then there is 2011.

What could be in the plans for Zend? Well, we have not completely baked it yet but there are some AWESOME product announcements coming. Kent Mitchell out Director of product Management gave a preview of Zend Server 6 at ZendCon with features like application activation that turns your PHP cluster into an iTunes like environment. But clusters are not available for IBM i, you say? Well how about an alternate PHP toolkit that gives full access to the OS with 100% Open Source code? In the words of the immortal Mark Shearer, Watch this space!


Events for 2011 you can certainly bank on are COMMON in Minneapolis in the Spring and St. Petersburg in the fall. I have just been accepted for a full day pre-conference workshop on PHP for the Spring COMMON and look forward to about 5-6 sessions too. I am cutting back on sessions as we are seeing real traction from community members like Alan Seiden, Brian May and Jeff Olen. These guys are not only PHP literate; they are in the trenches doing PHP every day! I challenge everyone to get out to some event or do some offline training or even consider presenting a session at your local user group. Pick something interesting, something fun. Challenge yourself. I don’t think you will be disappointed! Watch out for other in the community to offer ways to learn PHP on IBM i. The folks at iDevCloud are on the job and rocking out some really great opportunities.

2010 saw the birth and rebirth of iManifest. Jen Halverson has done an AWESOME job of helping “herd the cats” and her passion is immeasurable. I am glad she decided to join our team and offer HUGE assistance to a very necessary agenda.

We will continue to see product announcements and fixes and updates and more. PHP is not going away and neither am I! But some of my roles in the community will change as I need to focus on other things. More on that later.

I want to offer a hearty “thank you” to all of the folks who have welcomed me to their user groups. The IBM i community is a VERY special crowd and many of you have made me feel very much at home whether I travel near or far. It truly is a privilege meeting and speaking to the folks who love the IBM i as much as I do. And I look forward to meeting even more new friends in 2011.

In the spirit of the Holiday’s, I offer you all one wish:

Peace.

Friday, November 12, 2010

ZendCon 2010 - What a time!

ZendCon 2010 has come and gone. If you were there you saw some pretty cool things. If you were not there, why?

The IBM i track was well represented by some truly awesome speakers. Alison Butterill, Susan Gantner, Alan Seiden and Sam Pinkhasov all contributed to the usual cadre of PHP community speakers to make the overall experience well rounded and useful!

Each year I look forward to the IBM i evening customer networking event. This year we were able to hold it in one of the rooms at the hotel and this is a perfect opportunity to round up the IBM i customers in a central location where they can do the most important thing they can do at this event: COMMUNICATE. I think they all enjoyed it as we had to kick a few folks out of the room after last call. I think education is important but hearing what other IBM i customers are doing with PHP is of great value to everyone.

How about that ElePHPant!

One of the things I love to do with IBM customers is review any new features they are looking for in the Zend solution suite. This is important because we need to hear what you are up to and what you need to make the solution better for your organization. Just about everyone who has adopted Zend Server for IBM i would extol the virtues of better performance and a single Apache server. That came directly from the community. A highlight of Sam’s session had to do with a new toolkit that is being developed. We don’t have all the details yet, but it looks like it will add functionality and performance improvements over the existing i5 functions. More to come VERY soon!

The IBM i sessions are listed below and the slides should be available on JoinedIn for ZendCon2010 soon. Anyone looking for the handouts from the IBM i sessions, please check this out!
Web Services with PHP, Zend Framework and IBM i by Alan Seiden
PHP and IBM i by Alison Butteril
The MySQL - DB2 for i Connection by Susan Gantner
PHP for Batch Jobs on IBM i by Alan Seiden
What's New in Zend Server for IBM i by Sam Pinkhasov
Expanding IBM i Applications to the IFS Easily with PHP by Mike Pavlak



Start thinking about ZendCon 2011 now. I think you be just jazzed about joining us!

Monday, October 11, 2010

COMMON, LUG and Zend-Oh My!

Last week was a long one but exciting! First, flying out to San Antonio for the first annual COMMON fall conference and expo and then to the LUG in Rochester, MN.

COMMON was a very nice event where many new and veteran speakers joined together to welcome over 250 people to the Crowne Plaza hotel in San Antonio, TX. The facilities, expo and content seemed to fit just right.

The Zend booth saw a lot of traffic from current and future customers. Many people looking for alternatives to the current cadre of productivity tools and web solutions. PHP sessions were well attended, too. COMMON welcomed a new PHP speaker in Alan Seiden to share his perspective and he was well received. I hope to see Alan on stage at the Spring event for a “Best New Speaker” award. I have also heard that Alan had a good time himself! I think we’ll be seeing more of Alan! Looks like Alan made a new friend, too!



The location was a winner as many people found the time to run out to the Alamo and the Riverwalk to see some of the local culture and shopping. I decided to hide in my room and catch up on email but still managed to have a beer with an old friend who was kind enough to pick me up at the airport. (Thanks Paul!) There seemed to be a shortage of Shiner Bock in the bar, but each morning a new case or three was carried in. The hotel staff was great in assisting any last minute request.

Thanks to some fancy footwork by the folks behind the scenes at COMMON (thanks Ian!) I was able to squeeze all of my sessions into the first day and a half so I could join my CEO, Andi Gutmans at the LUG. For those who may not be aware, LUG stands for the Large User Group. This is an independent entity made up of organizations that represent some of IBM i’s largest installations. Usually only IBM speakers are welcome and they can be a very honest bunch. It is very rare that the LUG would welcome a vendor like Zend, let alone a lowly solutions consultant like me. But they must have liked what I had to say because they invited me back a couple of hours later for a demo of an install of Zend Server on IBM i. On top of a couple of great sessions I was asked to attend the LUG HUG which is an evening event where the LUG members get together for pizza and gather around tables like a Birds-of-a-Feather session. Met some more great people and had a great time.

I truly feel blessed to be able to speak to groups like these in my travels. Seeing the IBM i faithful exploring new options on our beloved platform is the best tonic for an aging soul. Working with customers who decide to stay on the platform or consolidate workload back on the platform is huge. But don’t tell my boss how much I like these events, he still thinks its work!



Wednesday, September 15, 2010

Updating Zend Framework on IBM i

Several IBM i customers have asked me about Zend Framework. Everything from should we adopt to how do we do it? I will talk about updating ZF in this piece but for a lack of sounding impertinent I have to reply to their inquiries about adoption with “It depends…”

It is no secret that the brass ring of PHP coders is framework based development. It’s not so much that Zend purports this approach as it is the community. The Zend Framework team has done an admirable job responding to the community with an enterprise grade solution. If you look at what solutions were around before Zend Framework you can easily see the need for such a solution. In its early stages, Zend Framework was created to address the plethora of frameworks that were being developed concurrently and were grossly incompatible. In other words, applications built with Cake would have to be modified in order to seamless integrate with Smarty. What’s even more concerning is the number of PHP developers out there who insist on creating their own framework for each company they work for. Since each company is different, they should get their own framework is the rationale. The reality is, however, a generic Framework that has attributes like modular design principles and a use at will architecture may very well be the right approach. But at which time? Many i5 shops are still kicking the tires of PHP and that’s OK. When they hear about Zend Framework they want to know more. I do not try to discourage folks from looking at Zend Framework, but do try to enlighten them as to the realities. And the reality is that you can use Zend Framework with just a cursory knowledge of PHP. But to understand Zend Framework you need a little more background in PHP and OOP. This is where RPG programmers get into trouble. Believe me, after 15 years developing RPG programs I too struggle with ZF and OOP. But that is because I feel I have to understand all the code before I use it. If you wait until you understand all of ZF before you use it, you may never get the chance to start taking advantage of its principles. So, let’s start in the beginning, updating your ZF implementation.

ZF upgrade process for IBM i

Zend Framework, the fabulously useful framework for building applications with PHP comes with Zend Server. But, the current version of Zend Server that installs on IBM i may not be as current as the version you wish to install. Or, maybe you would prefer to back-level the current version of ZF to be compliant with an applications requirement. Most users of the Zend Framework are far more interested in a more contemporary version of ZF as the development team is running fast and furious on new features. So, as there may be various ways to perform the update, the method identified here strikes me as the most efficient. As I try to maintain my position as one of the laziest programmers in New Lenox, techniques like this help me maintain a significant distraction rate while the computer does all of the heavy lifting! If you would like to share your favorite approach, please feel free to comment! This article will discus, in detail, the steps you can use to update the ZF library on your IBM i. In case you were wondering, this short snippet of ZF code can show you what version of ZF you have installed:
Let’s get a little housekeeping squared away. First, you will need to download the most current "stable" distribution from the ZF home page (http://www.zendframework.com/download/latest). As of this writing, 1.10.8 is stable. I chose 1.10.8 because I like things that are stable. That's why I am on an IBM i! If you prefer an older release you can check those out at the Zend Framework Archive . I brought this file down using the tar.gz option and not the .zip. I’ll explain why in a bit. You will also need all of the prerequisite License Programs as indicated by the Zend Server for IBM i Installation Guide available as a no-charge download at Zend.com. Last but not least, BACKUP YOUR WORK! Anyone who assumes all will be well with the universe when treading new ground has never met Murphy. As a ¼ Irishman I must acknowledge that little bugger and pay him his due. So, even a measly save file in QGPL is better than nothing. It sure wouldn’t hurt to dust off those operations skills and see if you can run the tape drive or at least make sure operations has backed up the IFS in the last few days (weeks, months, years?). The directory we will be messing with is ‘/usr/local/zend’ I would heartily recommend using the SAV command and saving that entire directory to a save file and then copying the save file somewhere. Tape is preferable; a network file share is OK too, as long as it gets backed up!


OK, with the housekeeping done I can climb down from my operations soap box and we can get busy. First you need the download file. This file can be brought down in either the windows .zip format or the Linux/Unix tar.gz. Since I am going to leverage the PASE environment to do my dirty work I chose the tar.gz format. But let’s explore what the heck that really means. Tar is a Unix command that stands for, believe it or not, Tape Archive. This is a method supported by nearly all Unix based systems and since PASE is an AIX runtime, it is no exception. PASE appears to fully supports the tar command and most of its options. Ok, that explains the .tar extension, but what the heck is the .gz mean to me? Ah, this is a little more interesting. In windows land we typically use a utility like PKZip to archive and compress all at the same time. In Unix land, we have two steps. I indicated that the tar command archives the files into a single tape file. The .gz stand for GNU-Zip which then compresses the file. So, since the file was archived first and then compressed, you need to do the reverse when opening up the files for access. As I indicated I like PKZip for getting rid of the .gz extension. Oh, and do not trust Windows to tell you the extension. You may need a DOS prompt to show you the real file name is: ZendFramework-1.10.8PL1.tar.gz.


So, chose your favorite PC based compression utility, open the GNU-Zip and extract the tar to a local directory. With the file in a local directory it is possible to FTP the file to a temporary directory like, /usr/local/zendsvr/share/ZFtemp on the i. That should be all you need your PC for! You can use an FTP utility if you like but I am still pretty comfortable with the command line options. Here is my script for FTP from the DOS prompt on my PC and I typically put things I need to FTP in a directory off C: called temp:

cd /usr/local/zendsvr/share/ZFtemp
lcd c:\temp

put ZendFramework-1.10.8.tar


With the file on the IFS we can now take advantage of the IBM i and let it rock through the rest of the process. So let’s rename the current ZF directory. It should be located in /usr/local/zendsvr/share/ and is called, simply enough, Zend Framework. From the i5 command line issue the WRKLNK command for the /usr/local/zendsvr/share/* directory and page down till you see Zend Framework. Take option 7 to rename the directory to something useful like ZendFramworkOldVersion or something like that. This technique may come in VERY handy should you need to back out the upgrade for any particular reason. Now take that temp directory and rename it to the proper Zend directory, or something you prefer.
From here you may start a PASE Shell by using the CL command CALL QP2TERM. This will start a PASE shell interface and any Unix command line loving geek out there will start to feel right at home since you are now, essentially, at an AIX command line interface. Remember that PASE is an AIX runtime so while it supports MANY AIX commands it may not necessarily support all of them. Check out the PASE command reference on the IBM website. From here, navigate to the directory where you wish to install Zend Framework. I chose the same directory it was already in so I would not have to adjust any hardcoded scripts or includes in the PHP.ini. The command would look something like cd /usr/local/zendsvr/share/ZendFramework and then issue the command to unzip the ZF file system. There are MANY files that make up ZF and to use netserver to do the drag and drop might be cumbersome. Ultimately, it’s up to you.

To unzip the file, or actually untar, the command is: tar -xvf ZendFramework-1.10.8PL1. let’s look at this command as it is a little different than your typically CL command. The –xvf represents switches that control the behavior of the command. x means extract the contents, v means give detailed messages about the extraction and f means the next parameter in the command is the file name of the archive. More information about tar can be found on the GNU website and also the manual .
Now that the unzip is complete there is only one step left to update the php.ini file. If you plan to use Zend Server for IBM i to load the path to the Zend Framework library, then update the path directive via the Zend Server Admin Interface. Log in to Zend Server and Navigate to the Server Setup tab and then the directives sub-tab. Click the twistie for Paths and Directories to reveal the php.ini directive for “include_path”. There should already be an entry for Zend Server in there. There is no change necessary as long as the new ZF files in the same directory. If another directory is selected, simply edit the value in the box to the right of the directive, click save changes and restart Zend Server. You are off to the races!

Friday, August 13, 2010

I want to do PHP on IBM i so what do I have to pay for?


My last blog highlighted the fact that there are free samples of PHP scripts that come with Zend Server. But I keep fielding the age old questions about what everyone wants for free. The truth is that NOTHING is free. With that said, let’s discuss the licensing arrangement between IBM, Zend and the customer. At a high level, IBM reached out to Zend to provide the PHP runtime, IDE and support for IBM i. This means that IBM does not provide direct technical support to customers for the Zend Stack. But IBM does support Zend in delivering support and solutions like Fast CGI and updates to Apache, DB2, etc.




The ubiquitous Zend Server for IBM i
First, let’s talk about Zend Server for IBM i, the PHP solution for IBM i. Zend Server is a complete PHP runtime with a variety of added features. There is a single distribution of Zend Server for IBM i and it will behave differently depending on which license key is installed. Installation of the Community Edition key will enable the PHP runtime and a couple of bells and whistles. Customers who purchase the full license key will get the additional productivity features like Code Tracing, Job Queue and PHP Application Monitoring. Since the download is the same for either product, come to Zend.com for the files. At this writing there are two option of running PHP 5.2 or 5.3. Also, we have moved to a PTF method for updates. So if you have Zend Server 5.0.1, all you need to do is download the PTF update for 5.0.2 and install using the IBM PTF method. This is a lot easier than doing a rip and replace and it gives the customer more control over the changes. In addition to the free scripts I mentioned in the last blog there are some other pieces like phpMyAdmin, the open source database utility that provides a GUI admin for you MySQL environment.

Zend Server Community Edition for IBM i
I mentioned earlier that NOTHING is free. But, customers of IBM i, do not have to pay for Zend Server Community Edition for IBM i. That is because IBM has paid for this feature for you! To get the Zend PHP runtime, known as Zend Server Community Edition for IBM i customers simply navigate their browsers to Zend.com and download the solution as indicated above and get a free license key at Zend.com. Please keep in mind that this is a perpetual license and will not stop running at the end of the support agreement and that all of the full version features are available for the first 30 days as a trial.

Where’s my free support for Zend Server?
The Community Edition shipped with the IBM i operating system or downloaded from zend.com comes with a first free year of Silver level support. The free year of support corresponds to the first year of usage of a new IBM i operating system purchase, or first installation of Zend Solutions. As Zend Server replaces Zend Core for IBM i, which also came with a first year of Silver level support, the first free year does not restart with an upgrade from Core to Server. This means that if you downloaded Zend Core for IBM i 6 months ago, you are entitled to 6 months of support for Zend Server for IBM i for the same IBM i serial number. If your first year of support for Core has expired, you are still entitled to upgrade to Zend Server Community Edition;you may use the new software unsupported of purchase a support subscription from Zend.

I’m out of support so what do I do?
To buy or not to buy, that is the question! There are two options. Customers who would like to continue some level of support can contact their friendly neighborhood Zend account manager for pricing on Gold or Platinum support. Support and software licenses are sold together on a subscription basis. This means that both support and the advanced features are licensed for a specific period of time, usually 1 to 3 years. There is a charge for this support, but you get what you pay for! Customers who choose not to purchase support can still get questions answered via the forums like WEB400 at Midrange.com or the Zend Forums. If a customer decides to not renew support, the product will continue to run but only with the Community Edition functionality.

So what about that Studio product?
Zend Studio for IBM i is the premier IDE for PHP applications. It is also the ONLY IDE that supports debugging PHP scripts on the IBM i, QED. Zend Studio for IBM i is available at no charge to IBM i customers. Additionally, customers ae entitled to a first year of free basic support from Zend. IBM purchased this product for everyone in the IBM i community so why not take advantage of it?
Zend Studio for IBM i is constrained, however. IBM i customers can only run, deploy and debug PHP scripts on an IBM i. Customers who wish to deploy against a local PC or Linux/Windows server must purchase the full Zend Studio product. There are a variety of license options available but all based upon an annual subscription model.
Zend Studio features are documented at Zend.com but at a high level there is support for PHP, JavaScript, HTML, CSS, Object Introspection, and much more.

I got an email saying that my support is running out!
Most likely you did. Just before the one year anniversary of your support expiration Zend will send out notices to customers who have downloaded the solutions and registered their servers. This is to provide you with planning options so that your support does not lapse. Both Zend Server Community Edition and Zend Studio are perpetual license so they will continue to run. But updates may not be as frequent and there is no support outside of the defined support agreements.

I hope this clarifies a few things. Ultimately, any questions can be addressed by an account manager. If you are not sure who your account manager is, please let me know or contact our sales folks at Zend.com.

Thursday, July 15, 2010

Sample code in Zend Server, Woohoo!

I work remote. You may work remote too. But as I was planning a trip to the corporate HQ I was asked to provide remedial IBM i training to some of our newer account reps. And the subject of the Samples directory came up. I know what you are thinking, yet another gratuitous post about Zend Server for IBM i, right? Of course it is. But this is beneficial to both paying and non-paying customers alike.

The samples directory that ships in the document root of Zend Server for IBM i has something that any company looking to explore PHP would like to see: free code! I have said several times that Zend Server for IBM i addresses many, not all, of the issues that IBM i shops have encountered. We fixed, enhanced or added a bunch of stuff to the product and the repose from those who have taken the plunge is overwhelmingly positive. The Samples directory addresses yet one more question raised by many an IBM i shop looking to explore PHP: How do I show my boss a PHP script running on MY machine? Lets’ explore each of the scripts available and how you can leverage them for your needs.


First let’s discuss the welcome page. Once you have Zend Server for IBM i installed and you start the Admin Interface (http://youribminamehere:10088/ZendServer) you are presented with a welcome screen. The screen lists 8 things that help you to learn PHP for IBM i. Option number 8 talks about the samples and all you need to do to see and run the sample code is click that link. Each has two links. The first runs the script and show the output. The second shows you the code that makes up the script. But if you have Zend Studio for IBM i handy you open up the Samples directory in the document root of your Zend Server instance.

I won’t go into boring detail about each of the scripts but it may be helpful to know that there are six examples. Hello World, SQL Access, SQL Access using Zend Framework, SQL Access to MySQL, Program Call and LDAP example. Let’s discuss the SQL Access script in more detail as that is my biggest requests: How do I show my boss some of our data in the web using PHP?
The SQL access example is no glamorous. But it does the necessary heavy lifting of going to a library on the IBM i, getting some data from a physical file and displaying it in an HTML table. The file in the example, SP_CUST, is located in the library ZENDSVR. This file contains several columns which are all requested via the SQL statement in the code example. Only customers with a customer ID greater than 1220 are selected from the database. Then, as the resultant data set is processed, each record is formatted to load into an HTML table. There are examples of error control and basic PHP and database control. A nice script for newbies.

For those of you who are adventurous, you can copy this script and modify it to display some of your very own data. There are only two changes you would really need to make. The first is in the SQL statement where you would create your own select option. The second is in the bind statement as you can omit or alter the lower-limit selection of the SQL statement. The rest of the code will generate the HTML table automatically. Please copy the PHP code and then modify it. Don’t destroy the original as you may want to get back to it at some point.

Well, I hope this helps a few of you who are thinking about kicking the tires of PHP. Like many other aspects of the PHP experience on IBM i, there is no charge for this feature. But if you are interested and having fun, I encourage you to take the next step and play some more. Maybe get a little education at Zend or SystemiNetwork. We’d love to see you there!