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!

Wednesday, June 16, 2010

My time at MITEC

What is MITEC?
MITEC is an event held in the Detroit area each year by several IBM midrange users groups in South Eastern Michigan. It has been my privilege to present to these folks several times and on June 8th I had the chance to do it again. Laura Ubelhor of Consultech Services is the primary ringleader for this event each year and she works tirelessly with her band of volunteer to do a wonderful job.


Getting There
The day before I drove up to Detroit with a good friend of mine, Jerome Hughes who is the webmaster for The Hideout, and had a great time up and back. Jerome is the guy that first got me interested in PHP and so I thought it was fitting that we travel together! For dinner we met several other speakers for a burger at the local Red Robin. Great seeing folks who we usually don’t get a chance to chat with as we are doing sessions.

Day of event
The day started out like many others in the world of user group events. There was a wonderful venue in the VisTa Tech Center that is part of Schoolcraft College in Livonia, MI. This facility was designed for events such as this and is by far one of the best places I have been asked to speak. I had a chance to present a couple of pretty standard discussions on the basics of getting started with PHP on IBM i. Both presentations were well attended and the discussions were lively. As always there were the standard discussions about Zend Server and what comes as part of the relationship with IBM.

Atmosphere
Last year there was a downbeat atmosphere as the downturn in the economy had taken a firm grip on the attendee’s and their jobs. This year’s event had a decidedly upbeat feeling to it and the attendee’s were looking for new ideas, concepts and topics. Several folks I had talked to had a wonderful experience and left the event with strengthened resolve to try something new in either PHP, RPG or CL!

Lab Challenges
I conducted an onsite lab and have to thank a few folks for helping make this turn out well. Let’s look at the issue and then see what we did to address it. I had 8 of 24 workstations reaching out via SSH to one of Dr. Franken’s machines. So the fact that some of the machines could connect while others could not was puzzling. I spent a fair amount of time playing around with the software before Jerome summoned the good doctor from his temporary lab in the lunch room where he was performing surgery on something organic for a change. When he heard the problem he immediately assessed that “this doesn’t sound like a problem at the server.” So the facilities engineers were brought in to look into the issue and they started tracing wire and looking at switches. Turns out that one of the switches was bad and was not opening a path out of the VLAN. After about 20 minutes they had a new switch installed and all was well. First, I have to thank the facilities staff for reacting to a switch configuration issue. As I have always offered, you really need to verify your network infrastructure before getting started. The next shout out goes to Stephanie Jerome Hughes who helped me with my session and did an awesome job helping round up resources. Both of these folks saw that I was working though lunch and got me a plate of food and brought it to me in the lab where we were working. By the time the students returned from lunch, we were ready to go!

Since this issue I have run in to two customers with similar constraints where there was a VLAN blocking SSH. The moral of the story is that you can never be too careful with your environment. Talk to your Network Admin and you might be surprised at what you can learn from each other!

Friday, May 14, 2010

What I did on my trip to COMMON

While there are probably several examples of great educational opportunities in the IBM i space, COMMON has to be the most popular. If you did not make it to COMMON you missed a great show and I’m going to take a few minutes to discuss what you missed. I have to say that I have been to several COMMON conferences and that this one was laid out really well. Reno was so spread out I got plenty of exercise walking form session to session. The fact that I gave 10 talks with one of the being a repeat means I really had my skates on in Orlando. But in all cases we were able to concentrate on a single area of the hotel where we had access to all of the session rooms. This was a really nice feature! The Expo and main event rooms were also very conveniently located.

Big speaker?
I wish I could tell you that I was the most popular presenter at the event. While the numbers are still being tabulated I must say I did OK but Scott Klement blew out nearly every room in which he appeared! In one case, the COMMON and Hotel staff opened an air-wall to make room for folks who were sitting on the floor and standing in the aisles to hear him speak. If I wasn’t so darn busy I would have probably checked him out myself! Check out his videos at you tube.

What about the expo?
The expo is what I look forward to the most. As a vendor, I had “booth duty”. This includes things like setup, working the booth, meeting people and breakdown. Obviously meeting the people there is the highlight of my trip and I met lots of folks who are doing all kinds of exciting things with PHP on IBM i. We even had a special visit from the PHP Elephpant who was making his debut appearance at COMMON 2010!

And the nightlife?
Then there were the evening events. The first night we had the power down, “Ask the Experts” session. I have always enjoyed this session as a customer because I had virtually unbridled access to IBM and community experts for many topics. I was working the Open System table with abunch of folks from around the world