Feedback (March 2009)

Article ID: 63078

PHP Spoken Here

Thanks for the great article ["Attention RPG Programmers: PHP Spoken Here," January 2009, article ID 62702]. PHP has been in my awareness for some time now, but I haven't taken the time to learn anything about it. Thanks for the foundation. Now, if I did want to start playing around with it, do I have to buy something first? We're on 5.4.

Donna Goldman

Via email

My boss and peers are abuzz about your PHP article in the January System iNEWS. While I have started doing PHP research (and it's nice to know that your list of references match up to many I have already found), it would be nice to have a simple "to do" list of getting PHP up and loaded on a System i box for little (or preferably no) cost. The Zend products both appear to be for-cost, which is impossible for me at this point (our company put a freeze on all capital expenditures), and while it would not be the first time I loaded non-IBM products on our development box, I would rather know that I am going with the right ones. Thanks for any help/direction you can provide!

David R. Sager

Via email

I read with interest your article(s) about PHP in the January 2009 issue. One thing I could not find in your articles (and maybe this was not your objective) was how to run or execute a PHP script. I think that PHP needs to be embedded in an HTML page (correct), so this means that the page must be served out of somewhere. Have you written any articles about the set up, configuration, or the minimum things that a System i shop must have to execute PHP pages?

Antonio Mira

Via email

Author Jon Paris replies: Thanks for the kind words. Glad to hear that the article stirred up some interest. Fear not--installing PHP is not only easy but free! There's nothing you have to buy, and there are a number of options you can pursue. As you have surmised, it was not the intention of this piece to show "how" to run PHP. Other articles previously published in System iNEWS and elsewhere have covered that territory as well as the details of how to obtain and install PHP.

The Zend Core is free to IBM i users, courtesy of a deal between Zend and IBM that gives Zend a fee for each copy of Zend Core for i5/OS that is downloaded. The original deal was for three years (which is up in April, I think), but my understanding is that the contract is being renewed for another three years, so you need have no fear. You can download Zend Core from zend.com/downloads. You need to register and supply your system's serial number, but that is all. There are pre-reqs you need to install before loading Zend Core, but they too are all free, and you probably have most installed already.

Not only is Zend Core free, but Zend Studio is also free to IBM i users and you can download it from the same page. Only Zend Platform (a high-performance version that you might consider in the future if running a large, heavily utilized site) has a fee associated with it. The only other fees are if you want Zend maintenance support beyond the free web-based support that comes with the basic package. The Zend forums are pretty good, though, and provide a lot of information on how to install the most popular of the open-source applications.

When you download Zend Core, I would suggest that you pick the version that includes an install of MySQL—you will need it for much of the open-source software you are likely to want to use. The other choice is whether to use the automated PC installer. I have found this works well but only if the PC in question is on the same network as the IBM i. When you use it over (say) a DSL connection, it doesn't handle the inevitable timeouts very well.

Use the other option if, for example, installing over a slower remote connection such as a DSL connection from home. You need to register with Zend and supply the serial number of your system—this is how Zend can determine that your authorization. Make sure to check the list of pre-reqs and install any missing items before you attempt to install Zend Core.

From the same site you can download and install Zend Studio (free of charge for IBM i users). Use this for all your PHP coding regardless of how you end up running it. If you want, you can use this just to "play" with PHP—but the only database support will be for SQLite.

If you do want to play with PHP, you can load it on a PC. The two distributions that I am most familiar with are XAMPP (apachefriends.org) for Windows/Linux and MAMP for Mac (mamp.info). These install an Apache web server, MySQL, PHP, and a bunch of useful tools. I personally use MAMP but have used XAMPP in the past. Both are good packages that save you having to collect all the "bits." Zend also offers a similar package of its IBM version for PCs—it includes DB2 support, which is nice, but I have not used it extensively.

Dynamic Memory

Your article ["Dynamic Memory for the CL Programmer," August 2007, article ID 20982] was just what I was looking for, and it will save me a huge amount of time discovering concepts that you have already discovered. And that assumes I would have discovered them at all.

Anyway, we have programs like your example. I knew that when we got 5.4 that I could revisit programs and change them to use either a larger RCVVAR or base the RCVVAR on a pointer. When I started my analysis of the changes, I used Google to search for "allocating memory in cl" (without the quotes), and your article was returned in the list of results.

The point is, I could use the IBM manuals to learn how to use a pointer in CL, then go looking for a built-in function to allocate memory, only to find out there isn't one. QC2LE in a CL program would not have entered my mind for three days, then I would have forgotten to omit the substring operations for each element in the list, thereby leaving the programs relatively inefficient.

Mike Stephenson

Via email

Author Bruce Vining replies: Thank you very much for your note. It's great to know that I was able to help a fellow developer to take better advantage of the i. You may also find some of my other articles to be of general interest to you. Go to brucevining.com and select Articles. There are several that are oriented to the CL developer.

We welcome your suggestions, criticisms, and opinions. Email your comments to editors@SystemiNetwork.com. All letters should include your name, your company name, city, and state or country. We reserve the right to edit letters for clarity and length. We also reserve the right to publish them in all electronic and print editions of System iNEWS unless the sender specifically requests otherwise.

ProVIP Sponsors

ProVIP Sponsors