Thank you to Alex for this honor. This site will continue to offer articles, presentations, event listings, and news about PHP, Zend Framework, IBM i, and other topics of interest to the PHP/i community.
IBM i computer, formerly named AS/400, iSeries, i5
IBM i had a solid presence at ZendCon, the Zend/PHP conference. IBM itself was a sponsor and staffed a booth (Tim Rowe and Tony Cairns). Here are a few photos from the conference. I’ll post more when I get time.
I recently received a question about how to use DB2 with Zend Framework on IBM i. Thomas wrote:
I would like to start with Zend Framework on i5 [IBM i] with Zend Server and ZF’s DB2 database adapter. I got this error message:
Qualified object name SYSCOLUMNS not valid. SQLCODE=-5016
I told Thomas about an improved DB2 adapter, optimized for IBM i, that I’d created in cooperation with Zend. Its usage is explained in my presentation, “From Zero to ZF,” on my Presentations page: https://www.seidengroup.com/presentations/.
Thomas wrote back to say this adapter worked perfectly for him, eliminating the error and improving performance. I believe this DB2 adapter (or something similar) will eventually be included with Zend Framework 2.0, but until then, it works well as a custom adapter.
Whenever I’m brought in to improve the performance of a PHP application, an easy change I make is to disable any PHP extensions that the application does not use. PHP extensions are code libraries written in C that add to PHP’s native functionality. Examples of popular extensions on IBM i are ibm_db2 and curl.
Boost performance by disabling unneeded extensions
I’ve noticed that Zend Server ships with most extensions enabled, presumably so that developers won’t have to see “extension not enabled” error messages. While the default configuration is fine as a starting point, developers should understand that each extension requires memory when loaded. When every bit of performance counts, it’s best to disable the unused extensions. Note: don’t disable anything till you read Several Extensions to Keep Enabled.
Managing PHP extensions
To manage extensions, Zend Server provides the “Server Setup / Extensions” tab. Each extension can be enabled or disabled with its “Turn on” or “Turn off” links. Changes do not take effect until the “Restart PHP” button is clicked.
Storage location for extension settings
Zend Server stores extension settings in a set of .INI files, one file per extension. On IBM i, the files are located in /usr/local/ZendSvr/etc/conf.d. Before making large-scale changes, you may wish to back up this folder. Then, if you discover you were overzealous in disabling extensions, you can compare the contents of conf.d with your backup to find out where you went wrong.
In addition to whatever extensions are required by a given application, I’ve found that several extensions are required by Zend Server itself. Do not disable these. So far, I’ve found that Zend Server requires these extensions to be enabled:
- simplexml (used by new open source toolkit)
If you accidentally disable an extension required by Zend Server, which you’ll discover when Zend Server fails to start properly, you must re-enable the extension in the correct .INI file and then restart Zend Server from a command line or menu. On IBM i, the command is STRTCPSVR SERVER(*HTTP) RESTART(*HTTP) HTTPSVR(ZENDSVR).
More performance tips to come
I plan to write about more techniques to improve PHP application performance, particularly on IBM i, that I’ve found to be effective in my consulting experience. Performance is a critical part of user experience that developers should not ignore. In addition to this practical need for good performance, I can speak for myself, at least, in saying I feel great satisfaction when I can take a slow application (sometimes the victim of an underpowered server) and, step by step, help it run faster and faster, till the performance is at least acceptable and sometimes quite fast. More to come.
A customer who is also an IBM business partner asked me how to learn more about Zend Server and get a basic understanding of PHP. He has already installed Zend Server for IBM i.
I suggested these steps:
- Attend a conference this fall where PHP will be discussed in an IBM i context. Here is a list of conferences where I (and others) will be speaking. All these conferences are excellent. Pick one and get there.
- Watch webinars at Zend.com. These are geared for PHP on IBM i: http://www.zend.com/en/resources/webinars/i5-os
- If you would like to see details of what Zend Server can do, get in touch and I’ll ask a Zend friend to do a demo for you.
- Attend a local PHP user group, such as one from this PHP user group list.
- For basic PHP knowledge, try the many books available, or check out Zend’s online training. Contact me if you would like advice about training or have specific requirements.
Next week I’ll be in Framingham to present at the Northeast System i Users Groups Conference (NEUGC). In early May, it’s Minneapolis for the COMMON 2011 annual meeting. Here are the dates and places of these great conferences:
NEUGC: April 11-13, 2011, in Framingham, Mass.
COMMON: May 1-4, 2011, in Minneapolis, Minn.
At each conference I’ll be presenting 6 talks:
- 4 about PHP on IBM i: web services, batch jobs, Zend Framework, and my research into best practices for db2
- one about making web development easier with free tools that run in a web browser (a fun one)
- one non-technical talk about how to stay healthy despite years of professional computer use (fun and interactive)
Both conferences have an exciting lineup of speakers and topics. I plan to learn a lot and meet many great people. If you are there, please say hello.
Secure Shell (SSH), a network protocol used every day by software developers, provides a fast, secure means to transfer files and submit commands to remote servers.
Zend Studio 8.0‘s SSH support allows users to save their PHP scripts onto remote servers such as IBM i.
How to set up SSH on IBM i
SSH runs as a server program, the SSH daemon (sshd). Before sshd can run, it requires a set of public/private key pairs.
Instructions for creating the key pairs and starting the server are given below. There are two versions of instructions, depending on the version of OS.
IBM i v6.1 and higher: one step creates public/private keys (if needed) and starts server
V5R3 and V5R4: two steps are required
1. First, create the public/private key pairs (only needs to be done once):
CALL QP2TERM ssh-keygen -t rsa1 -f /QOpenSys/QIBM/UserData/SC1/OpenSSH/openssh-3.5p1/etc/ssh_host_key -N "" ssh-keygen -t dsa -f /QOpenSys/QIBM/UserData/SC1/OpenSSH/openssh-3.5p1/etc/ssh_host_dsa_key -N "" ssh-keygen -t rsa -f /QOpenSys/QIBM/UserData/SC1/OpenSSH/openssh-3.5p1/etc/ssh_host_rsa_key -N ""
2. Then start sshd (“&” means to run in background):
On March 9, 2011, I’ll present a free webinar about how to create a Zend Framework project on IBM i. The webinar is at 9am PST, 12pm EST. Sign up here: http://www.zend.com/en/company/news/event/790_webinar-your-first-zend-framework-project-on-ibm-i
Here’s the complete list of my upcoming talks.
Zend Core and Zend Platform will reach “end of life” on July 1, 2011. Some of my clients have asked me what this will mean to them. In this article I’ll answer some common questions.
Q. What does “end of life” mean?
A. According to the official announcement, effective immediately, Zend Core and Zend Platform will no longer be sold except in special circumstances. Support will continue to be offered by Zend, for those customers with a support contract, until July 1, 2011.
Q. What software replaces Zend Core and Zend Platform?
A. Zend Server replaces both Zend Core and Zend Platform.
Q. If I currently use Zend Core/Platform and take no action, will my PHP scripts continue to run on and after July 1?
A. Yes, your PHP scripts will continue to function. The products will still work.
Q. Why should I upgrade to Zend Server?
A. You should upgrade to continue to get security patches, improvements, and, if you have a contract, support (whether at free or paid levels). In addition, Zend Server comes with the performance-boosting Optimizer+, new versions of the ibm_db2 driver, and PHP 5.3, which offers better memory usage and other benefits.
Q. Do I have to pay?
A. As with Zend Platform, advanced functionality and phone support are chargeable. As with Zend Core, basic functionality comes at no charge to you. The advanced version is called Zend Server. The no-charge version is called Zend Server Community Edition (CE). For more information, see Mike Pavlak’s blog post or ask me for assistance.
Q. Why the two versions of Zend Server?
A. It’s really one version with two modes. If you install the license, you get the advanced functionality. (You can get a trial license that allows you to try the advanced features for 30 days.) If you do not install a license, or after your trial license expires, you’ll have the basic (CE) functionality.
Q. Where can I get a trial license for advanced functionality, such as code tracing and monitoring?
Q. How do I download Zend Server?
A. For IBM i, go to http://www.zend.com/en/products/server/downloads
and click the “IBM i” tab. Choose an installer for “Zend Server for IBM i (PHP 5.3).” You’ll see one labeled “Windows installer” and one not labeled. The Windows installer might be easier for users less experienced with save files and FTP. The unlabeled one is a smaller download and is fine for anyone comfortable with save files and FTP.
Q. We’re using PHP 5.2.4. Can we continue to use a 5.2.x version of PHP?
A. Zend Server does offer PHP 5.2 versions, but I’d suggest using a 5.3 version if you can. The main thing to watch for is that some 5.2 functions are “deprecated” in 5.3, meaning they still work, but may trigger a warning message. Here is the full list of deprecated functions.
Q. What are the technical differences between Zend Core and Zend Server?
A. One major difference: Zend Server runs under a single native IBM i Apache web server rather than being split between two Apache servers. To see some of the configurations that differ, read my blog post, Differences between Zend Core and Zend Server on IBM i.
Q. Does user NOBODY still run the show (I have it hard-coded in a couple of programs)?
A. No. QTMHHTTP, the default IBM i Apache web server user, is the new user running the show. You’ll have to replace any NOBODY references with QTMHHTTP references.
Q. Any prerequisites before I install Zend Server?
A. Yes. For the list of prerequisites, go to the Zend Server resources page and find the heading “Zend Server for IBM i.” Underneath, click on “Release Notes.” Be sure to install the most current HTTP Group PTF level. If you do that, you’ll automatically be installing the FastCGI PTFs as well. Here are IBM’s instructions for checking your HTTP group level.
Q. Can I run Zend Server at the same time as Zend Core?
A. Yes. If you run them simultaneously, you should make a configuration change to PHP.INI regarding PHP sessions, to ensure that your Core and Server session files do not collide. In /usr/local/zendsvr/etc/php.ini, add these lines:
; Keep Zend Server's session data separate from Zend Core's. ; Be sure to actually create the /tmp/ZS folder first. session.save_path = "/tmp/ZS"
Q. The release notes say that I should remove previous versions of Zend Server and any older version of the FastCGI PTFs. Do I have to do that?
A. Only if you previously installed a beta version of Zend Server. Most likely, you didn’t install those FastCGI PTFs unless you installed Zend Server before.
Q. Is upgrading to Zend Server worth the trouble?
A. Yes. Besides the importance of being supported, Zend Server will grow with your PHP development efforts, while Core will be frozen at old levels. No need to rush or panic, but do create an upgrade plan. Try to do it before July 1.
If you have more questions or would like a demo of Zend Server’s advanced functionality, get in touch. I’m also offering my clients an affordable block of time to help them upgrade smoothly from Zend Core/ Zend Platform to Zend Server with a minimum of disruption. If you are interested in getting help with your upgrade, write to me on my contact page and specify “Upgrade help.”
Over the past week I’ve received several emails, ranging in tone from panicked to angry, seeking clues to the fate of MySQL on IBM i. The database vendor Oracle—recent buyer of Sun Microsystems, and therefore of MySQL—has issued an end-of-life notice for MySQL distributions on IBM i.
IBM i’s primary database is still db2, but many in the community have grown to trust MySQL when deploying MySQL-based applications such as WordPress, Drupal, Joomla, and SugarCRM. Some have trusted MySQL enough to let it into their inner application sanctum, using the IBM DB2 for i Storage Engine (IBMDB2i) to share data between MySQL-based applications and traditional db2-based apps and languages (think RPG).
Now that trust seems to be shattered.
Fortunately, MySQL is an open source product. Zend is still distributing existing versions of MySQL for i, and even if Oracle ceases to create new distributions, someone else can pick up the slack. An article in IT Jungle quotes IBM’s Allison Butterill and Ian Jarman as offering hope that IBM can find a way to maintain MySQL as an officially supported database, possibly with Zend’s help. It’s all speculation at this stage, but IBM seems to be considering the alternatives and wants to choose the right path.
Forgive me if I seem unduly sanguine about the situation, but many of us ran MySQL on the i before any of these official distributions existed. Back in 2005, the now-defunct site i5php.net hosted distributions of both PHP and MySQL that were compiled for for the IBM i (called the i5 at that time).
The dust hasn’t settled yet. Anything can happen. Yet I believe that MySQL’s open source licensing will, in the end, rescue it from Oracle’s decisions, allowing MySQL to remain viable on the IBM i—with the help of those who care.