Zend Framework community is here to help

A list of Zend Framework user groups is now available online: http://framework.zend.com/community/groups. I’m proud to say the list includes my own New York City area Zend Framework Meetup Group, co-founded by Ed Kietlinski and me in 2009, and affiliated with NY-PHP.

I always learn something from in-person user group meetings, even if I’m the one presenting. I go home with a lot to think about and a good feeling about my profession in technology.

Q&A: Upgrading from Zend Core to Zend Server

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?

A. http://www.zend.com/en/products/server/license

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.”

MySQL is still alive on IBM i

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.

IBM i was never affected by (quickly patched) PHP floating point vulnerability

Yesterday an IBM i customer of ours emailed me an announcement he’d received from Zend concerning a vulnerability in PHP concerning floating point numbers. Zend also included instructions for installing their “hotfix.”

Fortunately, IBM i was never affected by this vulnerability, which stemmed from a “design flaw in the x87 floating point unit that is part of an old Intel X86 chipset,” affecting only Intel-based 32-bit PHP builds, according to this NetworkWorld article about the issue.

Here is a table supplied by Zend that shows which platforms were affected (emphasis on non-vulnerability of IBM i added by me):

Platform Vulnerability
Windows YES
Linux (using 32-bit PHP build) YES
Linux (using 64-bit PHP build) NO
Mac OS NO
IBM i NO

ZendCon 2010

The 2010 “Zend/PHP Conference” welcomed the full range of the PHP community: open source contributors, small businesses, practitioners of diverse technologies and platforms, including Microsoft Windows, Linux, and IBM i, and the largest names in technology and business: Adobe, GE, the New York Stock Exchange. All these contributed energy and momentum to ZendCon.

I presented two talks (slides: http://alanseiden.com/presentations) and attended many more (slides: http://joind.in/event/ZendCon2010), given by some of the top names in IBM i and PHP. Beyond the great value of scheduled sessions, though, ZendCon offered even more.

As noted by Zend’s co-founder Andi Gutmans in his opening address, ZendCon’s value comes not only from scheduled sessions but from those unscheduled conversations in the hallway, at meals, and at evening networking events. ZendCon is about sharing knowledge, solving problems, and building relationships.

Personal highlights:

  • Alison Butterill’s presentation about IBM’s strong commitment to PHP
  • Susan Gantner’s sessions about interweaving RPG, PHP, and MySQL’s DB2 Storage Engine
  • Meeting Sam Pinkhasov from Zend’s R&D lab. He has such great knowledge that one time I followed him all around the conference center and into the elevator, peppering him with questions, before I finally let him go on the 5th floor.
  • The speaker’s reception, IBM i reception, and Disney-sponsored reception
  • Helping two people with their Apache configurations on IBM i. I continued to work on one of their configurations for 15 minutes after the lights were turned out, finding the command keys by feel alone. (Does that make me a geek?)
  • The Zend Framework roundtable where I got to ask the developers my burning questions.

I want to thank my employer, Strategic Business Systems, Inc., for allowing me to come and speak at ZendCon.

Below are my photos from the conference. I hope to return to ZendCon next year and to see many of you there!

P.S. For those of you in the New York area, come see me co-lead a roundtable recap of the conference at NY-PHP on November 23, 2010.

Andi Gutmans giving his opening keynote at ZendCon 2010

Andi Gutmans giving his opening keynote

Ray Taylor and I chatting before my web services talk at Zendcon 2010

Ray Taylor and I chatting before my web services talk

elePHPant with a fan at ZendCon 2010

elePHPant with a fan

IBM i networking event at ZendCon 2010

IBM i networking event

Ryan Watkins and Alison Butterill at the IBM booth, Zendcon 2010

Ryan Watkins and Alison Butterill at the IBM booth

Leverage the Power of IBM i Zend PHP button

"Leverage the power of IBM i" Zend PHP button

Susan Gantner speaking about RPG + PHP at ZendCon 2010

Susan Gantner speaking about RPG, PHP, and MySQL

Rocking at COMMON

COMMON’s fall conference and expo in San Antonio was the first of its kind, and a first for me as well. It marked my debut as a speaker for COMMON, as I presented three sessions about PHP on IBM i.

The conference brought the Power Systems and IBM i community together for learning and networking. I met many great people and caught up with industry friends.

After each day’s information-packed sessions, we gathered to relax and socialize.

A social highlight for me was the “Power Down” evening on Tuesday, October 5. The organizers had set up the Wii “Rock Band” game. This photo shows me on “drums,” Rich Nemerovsky singing, and Brian May playing “guitar.” I think Brian can actually play.

Drums, Alan Seiden; vocals, Rich Nemerovsky; guitar, Brian May, playing the "Rock Band" Wii game at Fall COMMON conference, San Antonio, Texas, October 5, 2010

Alan Seiden, Rich Nemerovsky, and Brian May playing Wii "Rock Band"

Zend Framework named among “Best of Open Source Software” for 2010

Infoworld has awarded Zend Framework a “Bossie,” naming ZF one of the top 10 open source application development tools of 2010.

Infoworld says:

The Zend Framework, from the creators of the PHP runtime, combines a business-friendly open source license with a set of high-quality, object-oriented component libraries for building serious Web applications. The loosely coupled components extend from authentication and session management to Web services and APIs to the popular Web 2.0 sites, and they include everything in between. You’ll also find components for the MVC (model-view-controller) design pattern and “RAD” tools to generate your project structure and populate it with MVC components, but you’re never locked in. You can take it just as much as you need and leave the rest.

I agree that ZF’s “use at will” architecture provides major benefits. Last week I helped a client set up a SOAP client and server using Zend_Soap_Client and Zend_Soap_Server, all from within a normal PHP script. While I normally do use ZF’s full MVC architecture, it’s not required.

Congratulations to Zend Framework!

VTMUG friends

I had a great time yesterday at the annual conference of VTMUG (Vermont Midrange Users Group).  I gave two talks about PHP on IBM i. I got to watch Skip Marchesani give a talk about the IBM i’s SQL Script Center, and John Valance speaking about Web 2.0.

I wanted to see Jon Paris and Susan Gantner’s presentations but conflicting time slots prevented that. I’ll try to catch Susan’s talk at the Zend/PHP Conference, where I’ll also be speaking.

This photo shows us relaxing after a satisfying day of teaching and learning at VTMUG.

Relaxing at the end of VTMUG's annual conference in South Burlington, Vermont

Relaxing after VTMUG's annual conference in South Burlington, Vermont

My upcoming PHP talks this fall (2010)

Please join me for my IBM i-focused PHP talks this fall. I’ll present these topics:

  • web services with PHP and Zend Framework
  • batch and command-line tasks with PHP
  • RPG-based 5250 applications as the basis for new web applications

…all focused on PHP on IBM i!

Here are the dates, locations and web sites with more information:

Sept 28: Vermont Midrange Users Group (VTMUG) education day, South Burlington, Vermont

Oct. 3-6: COMMON Fall Conference, San Antonio, Texas

Oct. 26: OMNI Users Group education day, Chicago suburbs

Nov. 1-4: Zend/PHP Conference (ZendCon 2010), Santa Clara, California

I look forward to meeting many of you at these great conferences and education days.

Two techniques for retrieving SQL from Zend Framework’s database components

Zend Framework’s database components can build and run queries without the developer’s having to touch the underlying SQL. Sometimes, though, developers need the SQL for diagnosing problems or to look for efficiencies. That SQL can be accessed with a choice of two main techniques:

getQuery()

getQuery() is a method of Zend_Db_Profiler and seems, along with getLastQueryProfile(), to be the standard advice for retrieving SQL of a recent query:

query = $profiler->getLastQueryProfile();
echo $query->getQuery();

Yes, getQuery() works, but what if I’m not using the profiler, or I need to retrieve SQL before a query has run?

__toString()

The “magic method” __toString() is simple and can be used either before or after the query is run. When applied to a Zend_Db_Select object, it generates an SQL string.

From the Zend_Db_Select documentation:

$select = $db->select()->from('products');
$sql = $select->__toString();
echo "$sql\n";

// The output is the string:
// SELECT * FROM "products"

__toString() is simple to use, yet is often forgotten when discussing how to retrieve SQL from Zend_Db_Select. I recommend it.