Resources for Upgrading to PHP 7 on IBM i

PHP 7 Zend ServerNow that speedy PHP 7 is available for IBM i, we’re helping our clients upgrade to this long-awaited release via Zend Server 9. I thought I’d share some of our favorite resources for performing this upgrade safely and efficiently.

First, we recommend Rod Flohr’s article Migrate to Zend Server 9 from Previous Versions, which contains both basic instructions and special tips.

Read more

Where to find DB2 for IBM i documentation

It’s not always easy to locate the official documentation for all features of DB2 for IBM i. Using Google Search is hit or miss, with full-text searches often bringing irrelevant results from other varieties of DB2 or from older versions. Many people don’t know that complete reference manuals are available for almost every aspect of DB2 on i.

Here are my favorite references for DB2 on IBM i:

  • The first place to look for many, but not all, manuals: DB2 for i Manuals by Release.
  • The grandma of all DB2 for i manuals is the DB2 for i SQL Reference. IBM’s description: “It contains reference information for the tasks of system administration, database administration, application programming, and operation. This manual includes syntax, usage notes, keywords, and examples for each of the SQL statements used on the system.”
  • Ever need to find a stored procedure or user-defined function on your IBM i, or get a list of tables or columns? Look no further than the IBM i catalog: IBM i Catalog Tables and Views
    • For example: Find all table functions using this SQL:
      select * from qsys2.sysfuncs where FUNCTION_TYPE = ‘T’;
  • IBM has begun an ambitious effort to provide an SQL interface for many system services, in “IBM i Services.” These services are documented here: IBM i Services
  • Still have questions? Try IBM’s forum for DB2 on i

What are your favorite DB2 for IBM i references? Let me know and I’ll add them to this list.

RPG & DB2 Summit: March 21-23, 2017, in Orlando

In just two weeks I’ll have the pleasure of joining some of the top IBM i development experts in Orlando for the RPG & DB2 Summit. Run by Susan Gantner, Jon Paris and Paul Tuohy, this conference is full of big personalities who create a warm, friendly environment that’s perfect for learning.

I enjoy the community feeling and how excited everyone is to solve development problems and share tips and techniques.

The RPG & DB2 Summit is one of the few training events that focuses exclusively on topics of interest to IBM i developers. That includes PHP and SQL, of course!

Check out the session grid and pay special attention to the Hands-on PHP Workshop on Monday, March 20, followed by several PHP and open source sessions given by yours truly and Zend’s Mike Pavlak, plus a whole array of SQL sessions. And maybe a few on RPG.

I think they should change the name of the conference to the RPG, PHP, SQL & DB2 Summit, don’t you?

Come join us!

Collaboration at COMMON

The 2015 COMMON annual meeting and expo, now in its first day, is helping speakers and attendees create innovation through IBM i integration: open source, closed source, IBM and vendor solutions. For example, of my six presentations during this conference, two are collaborations:

The Art of Performance Diagnostics, with IBM’s Dawn May, allows us to show, among other topics, how IBM i’s integrated performance tools complement green-screen tools and third-party tools (in this case, Zend Server) to pinpoint and solve performance issues (here, PHP-and DB2-based applications).

PHP Tricks for RPG Developers, a talk jointly created by RPG and SQL expert Birgitta Hauser and me, combines RPG, PHP, and DB2, allowing RPG to achieve graphical (charts and graphs, PDF and Excel files) and internet (json-based web services, flexible email) functionality using native functions.

Conferences such as COMMON serve a need that’s difficult to replicate back at the office—brainstorming and sharing possibilities among interdisciplinary peers, or sitting side-by-side with like-minded colleagues who work for different employers, to try something new. This week, for example, some of us plan to share knowledge on compiling binaries in PASE and to further the potential of open source on IBM i. I’m looking forward to presenting my talks (both joint and solo) and helping to realize new ideas with forward-looking colleagues during the conference.

Birgitta Hauser and Alan Seiden collaborate on their talk at COMMON 2015

Birgitta Hauser and Alan Seiden collaborate on their talk at COMMON 2015

Zendcon 2014 promo video for IBM i users

About Zendcon:

Find the Technology Refresh (TR) level of an IBM i

Update: I have since learned that the “PTF” IBM i Service (DB2 and SQL) provides one’s TR level more cleanly than with other approaches. I read of the improved approach in an article by Tim Rowe: https://systemideveloper.com/blogs/db2-for-i-services-use-sql-instead-of-system-apis/ by way of Club Seiden member PHP Dave.

IBM i services comprise a collection of DB2 and SQL objects that provide a wealth of system information. The GROUP_PTF_INFO view, for example, will display an IBM i’s Technology Refresh (TR) level to the user who runs this SQL:

SELECT CURRENT SERVER CONCAT ' is running ' CONCAT PTF_GROUP_TARGET_RELEASE 
CONCAT ' with TR level: ' CONCAT PTF_GROUP_LEVEL AS TR_LEVEL 
FROM QSYS2.GROUP_PTF_INFO WHERE PTF_GROUP_DESCRIPTION = 'TECHNOLOGY REFRESH' 
AND PTF_GROUP_STATUS = 'INSTALLED' ORDER BY PTF_GROUP_TARGET_RELEASE DESC 
FETCH FIRST 1 ROWS ONLY

When run on my server, the result was a single column, TR_LEVEL, with the value:

SEIDENI is running V7R2M0 with TR level: 3

Time for me to upgrade, yes?

Here was the original post with older techniques:

I recently needed to know if a client’s IBM i 7.1 system had Technology Refresh 4 (TR4). If it did, I could use the relatively new INSERT with remote SUBSELECT technique, which allows a single SQL statement to copy DB2 data from one partition to another. Such are the benefits of keeping current with Technology Refreshes.

After reading an article on TRs by Steve Will, I decided to document how to determine which TRs are installed on an IBM i system.

TRs, which were introduced with IBM i 7.1, are packaged as Program Temporary Fixes (PTFs). They can be found with the DSPPTF command.

First, determine the product number of the licensed internal code of  your system. For 7.1, the product number is 5770999.

Then use the DSPPTF command followed by this product number. For example:

DSPPTF 5770999

When run on my test system, this command produced a list of PTFs that included MF99007, MF99006, MF99005, MF99004, MF99003, MF99002, and MF99001.

Because Technology Refresh PTF numbers follow the format MF99nnn, where nnn is the TR number (bolded above), I knew that TR7, TR6, TR5, TR4, TR3, TR2, and TR1 were available. I was pleased to learn I could use TR4’s enhancements to DB2.

ZendCon+Tutorial discount expires Aug. 31

ZendCon, the premier PHP conference, October 27-30, 2014, in Santa Clara, California, has a discount expiring August 15 31 (extended!). When you register, be sure to include the tutorial day (Oct. 27). If you already registered but forgot to add the tutorial day, you can contact the organizers via a link at the bottom of the registration page. Among other half-day tutorials, I’ll be presenting two focused on IBM i:

  • PHP Performance on IBM i
    • If you’re interested in performance of PHP, or IBM i generally, in order to scale your application up to meet increased user demand, or if you have specific performance needs right now, you’ll want to attend.
    • Additional insight to be provided by IBM’er Tony Cairns (see below)
    • Testimonial from last year: “Our process now runs 30-50% faster, thanks to one tip from Alan’s presentation.”
      —Mike Meszaros, Software Developer, Specialty Pipe & Tube
  • DB2 with PHP in Depth
    • DB2 on IBM i has received major enhancements over the past year, including a dozen new settings in the PHP ibm_db2 middleware. Hear  how they can help improve security, performance, and stability. Other topics will include, but not be limited to:
      • Basic topics (with added commentary to make it interesting for everyone) such as library lists, prepared queries for security, persistent connections
      • DB2 in frameworks
        • Zend Framework 2
          • Including pagination (page-at-a-time logic)
        • Status of PDO and how it can be used in Laravel and other frameworks
      • The real scoop about modernization and the DDS vs. DDL (SQL) debate
      • Connecting to IBM i’s DB2 from Windows and Linux and other IBM i partitions
      • How to link MySQL-based applications (WordPress, etc.) to DB2 with the DB2 Storage Engine, with special tips
      • Using DB2’s HTTP features to make PHP-based web services even more accessible, including to allow RPG to call PHP and get results back
      • How to optimize queries
      • Strategies to safely open your application to the public
      • Topics and questions that YOU request (contact me in advance if you wish)

My co-presenter for tutorials will be IBM’s Tony Cairns, who helped bring PHP to the IBM i in the first place. He also created XMLSERVICE (toolkit back-end) and is a maintainer of ibm_db2 on the IBM i. One reason Tony comes to ZendCon is to hear from attendees such as yourselves. Normally he stays locked up in his lab. Take advantage of this opportunity to meet him. Watch Tony and me argue and debate in front of the class!

I’m also presenting a session during the regular conference about the PHP Toolkit for IBM i. I’ve updated my presentation with new features of the toolkit and best practices for calling RPG and COBOL.

ZendCon‘s topics are generally advanced ones to enable professional, enterprise-ready development practices. There’s also an IBM i track and plenty of networking time so that IBM i users of PHP can learn from speakers and each other, making the conference appropriate for intermediate users of PHP on IBM i as well.

Hope to see you there, October 27-30, 2014! Remember to register for tutorial day when you register for the conference. Get in touch with questions you’d like answered during my presentations.

See you at COMMON, May 4-7, 2014

Hope you enjoy these four videos (plus an outtake) I made with fellow speakers Dawn May and Charles Guarino to promote this year’s COMMON conference to be held in Orlando, Florida, from May 4-7, 2014, with optional pre-conference workshops May 3. I’ll be speaking about PHP and performance on IBM i. http://www.common.org/index.php/annualmeeting.html

Performance Tweet chat Monday, online workshop Thursday

Join me for two events this week sponsored by COMMON, a Users Group:

Details on online workshop: http://www.common.org/index.php/webinars.html

PHP Performance on IBM i: Tuesday, Dec. 10 (limited-time discount)

Update: a recording of this class is available at http://iprodeveloper.com/let-your-php-apps-fly-ibm-i-high-performance-php-demand

————-

This Tuesday, learn how to Let Your PHP applications fly on IBM i. Busy? You can attend while getting your work done, with three one-hour class segments separated by breaks.

“Our process now runs 30-50% faster, thanks to one tip from Alan’s presentation.”
—Mike Meszaros, Software Developer, Specialty Pipe & Tube

You’ll learn to quickly improve your application’s performance, including:

  • Give your app that “snap” by optimizing its front end as well as PHP
  • Configure Zend Server for performance
  • Diagnose bottlenecks
  • Leverage unique IBM i performance tools
  • Optimize DB2 and the IBM i toolkit

I’ll be there to answer your questions. What’s more, the presentation will be archived for 60 days so you can review the material afterward.

“Alan is the performance guru of PHP on IBM i. When we encountered unexpectedly slow queries and program calls, Alan showed us a configuration change that helped our application run 3x faster, creating happy users. Thanks, Alan!”
—Adam Chuk Shirley, PHP Developer, Sabel Steel Service

What: PHP on IBM i performance eLearning event
When: Tuesday, December 10, 2013: three one-hour segments with two one-hour breaks, starting 11AM and ending 4PM (ET).
Where: Online
Cost: $150 (but discounted to $99 through Friday, Dec. 6)

Details and registration: http://iprodeveloper.com/let-your-php-apps-fly-ibm-i-high-performance-php