PHP Toolkit for IBM i Conversion Tips

PHP Toolkit for IBM iRecently we’ve heard from several clients seeking help with Zend Server upgrades. While generally straightforward, upgrades can require an extra step with very old versions of Zend Server. “Old” means Zend Core or Zend Server 5.1 or earlier. Upgrades from these old versions may require a migration from Easycom to the “new” PHP to IBM i toolkit.

From 2006–2011, Zend Core/Server provided a special edition of the Easycom toolkit, which performed program calls and database queries. The prefix “i5_” makes Easycom function easy to spot. (Back in 2006, “i5/OS” was the name of the operating system that later became IBM i.)

In 2012, Zend replaced the older toolkit with a new, open-source toolkit leveraging native IBM access to the DB2 database. Developed by Seiden Group in collaboration with IBM and Zend, this free toolkit works with all versions of Zend Server. Shops who forget to upgrade their old toolkit will receive the error message “Call to undefined function i5_connect()” or “Call to undefined function i5_pconnect().”

Find your i5_ functions

It’s relatively easy to take an inventory of whether your code uses Easycom and to what degree. Run recursive “find” commands, as shown below, from either PASE or SSH, to find the i5_* functions.

call qp2term [opens a PASE terminal. SSH would work, too.]
cd /www/zendsvr/htdocs [or wherever your PHP code is located]

find ./ -name \*.php\* | xargs grep “i5_”

You may ignore strings such as ‘i5_lib’ and ‘i5_libl’. Focus on the function calls, such as these:

  • Connections: i5_connect or i5_pconnect. (
  • Database queries: i5_query, i5_prepare, i5_execute, i5_num_rows, i5_fetch_object, i5_free_query
  • Program calls: i5_program_prepare, i5_program_call
  • Data queue: i5_dtaq_prepare, i5_dtaq_send, i5_dtaq_receive
  • Data areas: i5_data_area_read, i5_data_area_write

Convert to the New PHP Toolkit for IBM i

One option is to purchase a paid Easycom license from Aura Equipements in France. Most of our clients, however, have opted to  convert i5_* functions to a combination of native db2_* functions (for queries) and new toolkit calls (for program calls and other non-database-query functions). Everything needed is shipped with Zend Server today. The new toolkit is open source, its code understood by many in the community, therefore easy to support and find answers for.

We’ve helped many IBM i shops create and implement a plan to smooth their PHP toolkit upgrades. From our years of experience, we’ve built an issue checklist and remediation processes that result in faster, easier conversions.

Contact me to discuss how we could save you time and effort with your upgrade.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *