Sep 07

Installing PHP again to try the XMLSERVICE toolkit

There is a lot of discussion around the new IBM/Zend toolkit which is meant to replace the EasyCom toolkit currently shipped with the Zend product so I thought I would give it a quick spin to see what all the fuss is about.

First thing I had to do was remove the existing Zend PHP install and clean everything up, no point in testing the new toolkit with a down level server. As usual the un-install takes a very long time to accomplish and does not clean up after itself so a few additional minutes are required to remove the remaining links and objects.

Next we looked for a copy of the ZendServer for IBMi, not the easiest item to find on the Zend site but we did find it and download the zip file. We also noticed a Cumulative PTF package which seems to be needed as well but to be honest we are not sure? The Cum package is actually larger than the base package? Anyhow we decided to download both items and start the install.

Installing the base product took 40 minutes with an additional 13 minutes to install the MySQL server. Because we had downloaded the Cum package we then installed it using the supplied instructions which failed! The install process automatically starts all of the processes but the PTF install fell over because they were started. Once we had stopped all of the running processes the PTF install process took a further 36 minutes to complete. Your times may vary depending on the server and the number of active jobs etc.

Next step was to find the XMLSERVICE package, we have only ever found it using a link provided on the forum boards so not even sure it is the right one to use? (If you know the correct link let us know). We downloaded the stable release and as per the instructions uploaded the save file to the IBMi and restored the XMLSERVICE library. The library has a number of source files and objects which require compiling before you can use the services. We did not have Option 31 for WDS (the RPG compiler) installed so we had to install that first. However we are now at a standstill because the compiler could not compile the PLUGXML module due to some parameters being passed incorrectly in the source code. We have posted to the forums asking for help as we are not RPG programmers and have no idea why the compiler is complaining about the code?

That’s as far as we have got today, its taken 5.5 hours so far and while we do have the Zend Server installed and running we do not have the XMLSERVICE up and running yet to give it a try.

Once we have the problems figured out and the programs created we will create a couple of simple tests to try the new XML routines out against the old i5_toolkit routines. Keep watching for the results..


Sep 03

PHP ZendFramework 1.9.2

We have started down the path of developing the What’s On website using the ZendFramework. The main reason for this is to understand the strengths of the framework as opposed to standard PHP development.

The first phase was to take the Quickstart as provided by Zend and set up the environment to allow it to run on the system. We did this on the IBM ‘i’ initially but had so many problems with the set up we decided to move it off to the Linux platform until we had it running then migrate it back to the IBM ‘i’. That’s one of the strengths of the language, we know we can develop it on one platform and migrate it to another with little effort.

Unfortunately the Quickstart is full of challenges which would turn any newcomer off. We had to recompile the PHP product 4 times to get all of the modules installed that the Quickstart depended on. Even after all of this we found errors in the code supplied which confused us at first especially as the error page would never show any error information. Eventually we gave up on the Quickstart, the last error was pointing into the ZendFramework code stating dual sessions were being started! That was the last straw, Zend should at least provide a sample which works on any PHP install. Our advice is to skip the Quickstart and build out your own project you will only frustrate yourself trying to fathom out why its not working.

We also decided to build our own Quickstart, the What’s On website is a community site which provides the general public with events running in the local area. It allows the public to enter event information for free which we list for others to see. We recently redesigned the entire site and are testing and building it out at the moment. This new development gives us the chance to see what the ZendFramework provides as we develop the site side by side. The initial page looks good and after some poking around we now understand how the parts fit together (debug will do that for you) and hope this will enable us to develop the new site using the right techniques. It took us about 2 hours to get the site up and displaying the first page. This included the configuration of the virtualhost and the directory structure required for the MVC framework.

We hope to post some of the findings as we move through the development of the new site, we have already replaced a number of functions we built by Framework classes.. The biggest challenge we had was setting up the CSS to get the image files as we struggled to understand where the path was as the page was built.


May 04

Just Back..

Lots of exciting things have been happening for for us which have taken up a lot of time and effort on my behalf. I did manage to get to the forum’s a couple of times in recent weeks but the blog has just had to wait. I was sad to hear about the COMMON problems and in particular about the financial situation and the impact that is going to have for the future of the organization. I noted with particular interest the problem which is now going to face people like Scott Klement who is a major advocate for the IBM i and his ability to attend future COMMON events. I don’t attend COMMON very often any more due to the cost involved (not only financially but also time) but do see the benefits some gain from attending such events.

Perhaps there is an alternative? If you look at the distance learning technology in use by our colleges and universities perhaps that could be a better alternative?

I will be working on a new PHP Framework post which I had hoped to have finished by now but with the trip to Europe it has had to take a back seat.

For those who attended COMMON I hope you had a successful week and lets hope they manage to find a way to ease the financial burdens.


Apr 17

Has IBM lost control of its CCSID’s?

Having just spent a whole day trying to get to the bottom of a problem with the PHP/HTTP servers on my system I decided to look at just how certain activities action the CCSID of a file. I was surprised at just how many CCSID’s used in the file generation on the IBM ‘i’…

The tests were carried out on the i515 which is running V6R1, I have just finished installing PHP and setting up the ZendFramework after many hours of debug trying to find out why even after managing to get the PHP pages to work, I had more problems when I started to build the Framwork pages. I now have a fully function PHP installation with the Framework in play but not sure why it started working really! So I decided to do a few tests to understand why the pages would not work out of the box, after all they worked before I was just re implementing them.

First test I did was to create a brand new WebServer using the IBM HTTPAdmin process. It creates the directory structure and an initial index.html which is where all of the problems I have seen before originated from. This resulted in a CCSID of 13488 for the index.html, changing the extension to .php and adding a few lines of code to display the php info resulted in no php information being displayed but when looking at the source generated I found that Mozilla would show the text with no problems displayed but IE showed a space between every character (actually it was a hex code which was not interpreted until I copied it to an editor which allowed me to see them). I changed the CCSID to 1252 but it still had the same result? Eventually I deleted the entire content and rewrote it back which resulted in the page being displayed with all of the PHP info. This told me that the CCSID of the text in the file was different to the CCSID of the file object?

Next I decided to try the IBM WDS RSE IDE which should should have been consistent with the HTTPAdmin process, or so I thought? This resulted in a page being created with a CCSID of 850? Again the same rules about changing it existed as previously.

Navigator for i (IBM Systems Navigator) resulted in a CCSID of 1252, I simply dragged the file from my desktop to the IFS. The file had been created on the desktop using Notepad previously. The page displayed correctly in PHP and normal HTTP html form.

As I expect to use Zend Studio I created the next file directly through the file manager in Studio. It resulted in a CCSID of 819 for the file. After some investigation I found out that because I was using SSHD it was going through the PASE environment, checking the PASE Environment shows a CCSID of 819 so at least that ties up. Well not really but it made the most sense so far.

I wanted to see what would happen if I copied source files from the QIBM libraries to the IFS, they result in a CCSID of 37, checking the QCCSID value which is set to 37 this also seemed to make some kind of sense?

Finally I thought I would try to use the i Access send file to host! That was a bad mistake! Below is the resulting screen which shows the command APVAFILE PUT WWW TESTSERVER/HTDOCS/DSKUTIL.C TEXT ASCII CRLF SRC LRECL 80 (thats part of it) being entered in the 5250 session! I think this is a bug which I will pass into IBM to see why it would do this? It did not stop me from entering the information to send it to the IFS?

Strange behaviour?

Strange behaviour?

So as you can see IBM or its vendors have no consistency when it comes to the CCSID they generate the files at in the IFS! If anyone has any insight as to why this is happening and how I can add the consistency back it would be appreciated.


Apr 16

Virtual Hosts and PHP now working

The installation of the test beds for PHP development are now in place and tested. I did have some issues with the pages again but reading back through the Blog entries has helped me get it all going again.

Here are the Blog entries which helped. and The second link was the most helpful as I had the same problems as before with the page generated by the IBM HTTPAdmin process. The CCSID was causing the PHP to be ignored, I looked at the source code in Mozilla and everything looked good but IE showed the characters all being spaced?? I remembered the issue had been seen before so I created a test page in notepad copied it to the directory and everything showed up exactly as it should.

Now I am going to look at the Studio, I notice it does not have iSeries connections defined so the request to add the same capabilities from IBM RSE to the Studio have gone unanswered as of yet. I have to map drives for the Studio to work with the system.

I will be working on a couple of technology tests using the Framework and the database generated by RAP and JobQGenie. Then expand that to provide PHP based interfaces to the products. I am hoping the Zendframework DB2 connectivity issues have been resolved and the PDO object will work???


Oct 02

Automated Replication for Objects

Been a long time since the last post, that’s because we have been busy developing a journal scraper and object replicator for RAP. The principle was to initially store the updates and apply in sequence with the apply of the journal receiver on the target, but that is going to have to wait as the management of the DASD on the target has to be a primary concern.

We now have a functioning application and will be testing it over the coming months. The use of the journal data we could extract from the Audit journal has allowed us to closely manage how we create the changes which have occurred on the source and replicate them to the target. We wanted to make sure we did not replicate objects unless absolutely necessary.

The initial process will handle *CLS, *CMD, *JOBD, *MENU, *MSGF, *PGM, *PNLGRP, *SBSD, *USRSPC, *FILE(PRTF and DSPF). We feel these are the major application objects which chnage and need to be replicated for application recovery. As we discover more requirements we should be able to implement them in future releases.

We handle most changes to the objects especially authority changes, because we have automated profile replication built into the base product we now provide the same level of object cover as some of our HA cousins!

The new features will be released either as upgrades to current versions or as a new version once we have fully tested to process. We are also improving other aspects of the RAP product with feedback which has been received from our customers.

I am afraid the Framework project is on hold again as we work to get this new feature out to the customer base.


Sep 03

Zend Framework installed with ZendCore 2.5.2

If you intend to use the ZendFramework I would suggest you install a newer copy than the copy installed by default by the ZendCore Install. ZendCore 2.5.2 will install ZendFramework Version 1.0.3! The latest stable copy of the ZendFramwork is 1.6.0 which as you can see is lightyears ahead of the Framework installed by Zend. Continue reading

Aug 28

Automated unit testing in PHP using PHPUnit

As part of the ZendFramework excercise I am following the author describes some automated testing process for the Framework modules as we build them. He talks about using the PHPUnit testing software which is available here This allows a developer to write automated tests for his objects as he develops and greatly improves the security of the code. The installation manual is here which describes how to install and run the product.

Couple of things you need to know before setting this up for the i5 Continue reading

Aug 27

Installing a MySQL interface

I am in the throws of going through a tutorial which shows how to set up and use the ZendFramework. It comes as part of a book I found which goes into some detail about the ZendFramework but in a much more readable (understandable?) method than the documentation. Once I have been through the book and if I find it is very useful I will post a link to it on the blog. Not sure yet how good it is but early indications are it is pretty thorough and well put together. One of the requirements of the tutorial is the use of the MySQL database, as this is optionally installed with ZendCore. I wanted to install the interface I like to use for MySQL which is phpMyAdmin. The alternative method which is available using the QP2TERM or qsh and calling the mysql binary is pretty clunky and not easy to use, phpMyAdmin is a great alternative and easy to install. Continue reading