March updates to PHP Toolkit for IBM i

All are invited to try and enjoy this update before it’s officially packaged:
XMLSERVICE 1.7.8 and PHP Toolkit 1.5.0

My favorite part is in the performance improvements. There are also bug fixes to data areas and data queues, configurable PASE CCSID, an HTTP-based driverless transport, and more.

Change log for PHP Toolkit (front end)

Change log for XMLSERVICE (back end)

Try these and let me know how it goes (especially if you encounter any issues).

Posted in Announcements, IBM i, iSeries, Open Source, PHP, System i, Zend's PHP toolkit for IBM i | 3 Comments

Technical conferences make business sense

With COMMON’s conference starting in little over a week, I’ve written a blog post to show how managers can achieve a compelling return on investment (ROI) by sending their staff to technical conferences.

Read “Send your technical staff to conferences” on the IBM Systems Magazine PowerUp Blog, then share your own stories of conference ROI in the comments section of the blog.

P.S. I hope to see many of you at COMMON in Austin, Texas., to put the guidelines into practice!

Posted in Events | Leave a comment

Tell me how a conference has helped you

Have you ever learned something you really needed to know, made a valuable contact, discovered a better way to do things, decided on a future direction, as a result of attending a conference?

Have you found ways to save money for your employer or company? Avoided a mistake or taken advantage of an opportunity that was good for business?

I’d like to hear about it.

I’m writing an article about the value of technical conferences, especially from the business viewpoint. Please send me your anecdotes (could be one sentence long) about dramatic value that you’ve obtained from attending a conference, or if you are the employer or manager, the value of sending your employees to conferences.

You can leave comments here on this blog post, or write to me privately on my contact page.

Thanks!

Alan

Posted in Uncategorized | Leave a comment

Zend Server for IBM i download page

If you’re looking for Zend Server for IBM i, its updates or hotfixes (such as the recent SOAP hot fix), or the latest official PHP Toolkit release, try the new Zend Server download page for IBM i.

The new page is easier to use than previous versions because it’s exclusively for IBM i (to some, “iSeries”). In the past, the download page contained a separate tab for every platform, with the potential for error and requiring more clicks.

Thanks to Zend for the improvement.

Posted in IBM i, iSeries, System i, Zend Server, Zend's PHP toolkit for IBM i | Leave a comment

Why PHP on IBM i

A colleague asked me for a catchy quote about why IBM i aficionados should choose PHP. Some thoughts to start with:

1. With PHP you can build your dreams.

2. PHP lets you start simply and grow.

3. PHP combines open source with the stability and support of IBM i.

4. Learn PHP and you’ll gain a skill you can use everywhere, but that you’ll WANT to use on IBM i.

Posted in IBM i, iSeries, Open Source, System i, Zend Server | 8 Comments

How to prevent Easycom from loading

Several clients have asked me how to prevent their older Easycom components from loading, now that they’ve migrated from the Easycom toolkit to the new open source IBM i Zend toolkit.

Here are instructions based on suggestions from Rod Flohr of Zend Support. These tips have worked for me on Zend Server 5.6 for IBM i and will probably work on older releases as well.

Prevent Easycom extension from being loaded by PHP

1. Go to the Zend Server administration interface in your browser: http://yourIBMi:10088/ZendServer/.

2. Navigate to the Server Setup -> Extensions tab.

3. Find Easycom on the list of extensions. If the extension is On, click the “Turn off” link on the same line to turn it off.

4. You should see this message: “The extension ‘Easycom’ will be turned off after restarting your PHP”. You don’t need to restart PHP now if you plan to do so later, at the end of “Prevent I5_COMD daemon…” (below).

5. Also look for an extension called ‘pdo_easycom,’ which you may see if you had downloaded or purchased the Easycom product directly from the vendor. If it is there, turn it off as well.

Prevent I5_COMD daemon from starting in ZENDSVR

If you see a job named I5_COMD running in the ZENDSVR subsystem, but no longer use the Easycom toolkit, you may wish to follow these steps:

STEP 1: Rename the startup program that launches I5_COMD. From a 5250 command line:

RNMOBJ OBJ(ZENDSVR/ZCCSTREACD) OBJTYPE(*PGM) NEWOBJ(ZCCSTREACX)

This renaming will “hide” I5_COMD’s startup program from Zend Server’s startup procedure. (Don’t worry—the “missing object” message is monitored—no errors.)

STEP 2: Stop and start Zend Server from the menu. From a 5250 command line:

GO ZENDSVR/ZSVMENU

Use option “2. Stop Zend Server Subsystem”

Verify that subsystem ZENDSVR has ended and that there are no jobs named ZENDSVR in the QHTTPSVR subsystem.

Next, use option “1. Start Zend Server Subsystem.”

Verify that subsystem QHTTPSVR is running and contains the usual ZENDSVR jobs. Verify that subsystem ZENDSVR is started, but without I5_COMD inside.

Posted in IBM i, iSeries, PHP, System i, Web development, Zend Server, Zend's PHP toolkit for IBM i | 3 Comments

Using procedures and service programs with the PHP Toolkit for IBM i

The open source PHP Toolkit enables PHP applications to call procedures (functions) that are defined within RPG service programs on IBM i. (For more information on the toolkit, see my toolkit information page.)

Here’s an example that will work with PHP Toolkit API version 1.4.0 or higher. I also included some ‘boilerplate’ to show best practices for connecting to the toolkit and checking for a successful connection. The illustration of how to call a procedure is in the second half.

<?php
require_once('ToolkitService.php');

// connect to toolkit using DB2 credentials (can also leave blank for default authority)
try {
    $conn = ToolkitService::getInstance('*LOCAL', 'MYUSER', 'MYPASS');
} catch (Exception $e) {
    // Determine reason for failure.
    // Probably database authentication error or invalid or unreachable database.
    $code = $e->getCode();
    $msg = $e->getMessage();

    switch ($code) {
        case 8001:
            // "Authorization failure on distributed database connection attempt"
            // Usually means a wrong DB2 user or password
            echo 'Could not connect due to wrong user or password.';
            break;
        case 42705:
            echo 'Database not found. Try WRKRDBDIRE to check.';
            break; 
        default:
            echo 'Could not connect. Error: ' . $code . ' ' . $msg;
            break;
    } //(switch)
    die; // couldn't connect...handle this however you wish     
} //(try/catch)

// set stateless mode for easy testing (no 'InternalKey' needed).
// (setOptions() introduced in v1.4.0)
$conn->setOptions(array('stateless'=>true));

/* If you wish to test this script but you don't have a real service program,
 * use parseOnly and parseDebugLevel as shown below.
 * No program will be called and you'll get your original values back.
 * Simply uncomment the next line to try this great testing feature of the toolkit.
*/
//$conn->setOptions(array('parseOnly'=>true, 'parseDebugLevel'=>1));

// define several input/output params
$params[] = $conn->AddParameterChar('in', 1,'Division', 'DIV', 'A');
$params[] = $conn->AddParameterChar('in', 6,'Product', 'PROD', '123456');
$params[] = $conn->AddParameterPackDec('both', 7, 2, 'Quantity', 'QTY', '4.53');
$params[] = $conn->AddParameterZoned('out', 5, 2, 'Price', 'PRICE', '0');

// define a procedure return param. Can be any type, even a data structure
$retParam = $conn->AddParameterInt32('out', '4-byte int', 'MYRESULT', '13579');

/* Call service program procedure. 
 * In this example, assume your program is MYLIB/MYPGM and has a procedure/function 'myproc'
 * (procedure name is case-sensitive).
 * Note: specify optional procedure name in parameter 5, an array with associative index 'func'.
*/
$result = $conn->PgmCall('MYPGM', 'MYLIB', $params, $retParam, array('func'=>'myproc'));

if (!$result) {
    echo 'Error calling program. Code: ' . $conn->getErrorCode() . ' Msg: ' . $conn->getErrorMsg();
}

echo 'Called program successfully.<BR><BR>';
echo 'Input/output params: QTY: ' . $result['io_param']['QTY'] . ' PRICE: ' . $result['io_param']['PRICE'] . '<BR>'; 
echo 'Procedure return param MYRESULT: ' . $result['retvals']['MYRESULT']; 

/* 
The above will output something like:

Called program successfully.

Input/output params: QTY: 4.53 PRICE: 0.00
Procedure return param MYRESULT: 13579

*/
Posted in IBM i, iSeries, PHP, System i, Zend Server, Zend's PHP toolkit for IBM i | 1 Comment

ZF2 and DB2 for IBM i

I’d like to address questions about DB2 support in Zend Framework 2.x. Because I helped create the IBM i-friendly DB2 adapter for Zend Framework 1.x, I’ve followed the development of a similar adapter for ZF2.

(updated January 30, 2013, upon the release of ZF 2.1)

Q. Does ZF 2 include an adapter for DB2?
A. Yes! Starting with ZF 2.1, which was released today.

Q. Is Alan’s IBM i-friendly DB2 adapter for Zend Framework 1.x needed in 2.x?
A. No. Because ZF’s Zend_Db equivalent in 2.x works differently than in 1.x, my 1.x component is not needed in 2.x.

Q. Does ZF 2.1’s DB2 adapter work with IBM i?
A. Yes! Please try it and provide feedback to the ZF team.

Posted in db2, IBM i, iSeries, Open Source, PHP, System i, Zend Framework | Tagged , , , , , , , , , , | 11 Comments

Alan Seiden Consulting LLC

I’ve started a consulting firm dedicated to helping companies attain superior results with PHP, Zend Framework, IBM i, and related technologies such as Zend Server, DB2, and the new PHP toolkit.

We will provide guidance and best practices, training, mentoring, troubleshooting, performance help, team building, speaking, writing, and advocacy.

My first speaking engagement with my new company will be the OCEAN conference on July 20, 2012, in Southern California. Hope to see some of you there.

Thanks for your support. I will be available starting July 2 after a short vacation. I look forward to working with you.

Alan

Posted in Announcements, db2, IBM i, PHP, Zend Framework, Zend Server, Zend's PHP toolkit for IBM i | 4 Comments

Which version of Zend Server for IBM i do I have?

Here is the easiest way to determine which version of Zend Server is installed on a given IBM i system.

From a 5250 command line, follow these four steps:

1. GO LICPGM
2. Take option 10 (Display installed licensed programs)
3. Scroll down to the licensed program 2ZSVRPI 
     (on my system it's the last entry)
4. Read the product description,
     containing version numbers for Zend Server and PHP
     in the form "Zend Server for IBM i [version] ( PHP [version])"

On my IBM i, I see:
2ZSVRPI   *INSTALLED   Zend Server for IBM i 5.6.0 ( PHP 5.3 )
so Zend Server is at 5.6.0 and PHP is 5.3.

Thanks to Zend’s Sam Pinkhasov for this tip.

Posted in IBM i, iSeries, PHP, System i, Web development, Zend Server, Zend's PHP toolkit for IBM i | Tagged , , , | 2 Comments