Archive

Posts Tagged ‘PHP’

Alan Seiden Consulting: PHP and IBM i Expertise › March updates to PHP Toolkit for IBM i

March 27th, 2013 Comments off

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


Read the original at Alan Seiden Consulting: PHP and IBM i Expertise.

Alan Seiden Consulting: PHP and IBM i Expertise › How to prevent Easycom from loading

February 18th, 2013 Comments off

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.


Read the original at Alan Seiden Consulting: PHP and IBM i Expertise.

Alan Seiden Consulting: PHP and IBM i Expertise › Using procedures and service programs with the PHP Toolkit for IBM i

December 27th, 2012 Comments off

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

*/


Read the original at Alan Seiden Consulting: PHP and IBM i Expertise.

Alan Seiden Consulting: PHP and IBM i Expertise › ZF2 and DB2 for IBM i

October 16th, 2012 Comments off

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.


Read the original at Alan Seiden Consulting: PHP and IBM i Expertise.

Young i Perspectives › Why IBMi – Research Effort

August 31st, 2012 Comments off
I am putting together a form of research initiative that aims to quantify *why* a non-IBMi tech person should consider or pursue IBMi.  I believe one of the best sources of this information can come from the community, so I’ve setup a GoogleDoc that can be edited by anybody (no Google signup required).
If you are interested in contributing then please head over to this link:http://bit.ly/OyCd3M
The results of this will be placed onto IBM’s IBMi wiki page for all to see and act as a place we can point people.
Here’s a tweet phrase if you are looking to share socially:
Why #IBMi? If you had to convince a #Ruby #PHP #Java dev to run their app on #IBMi what would you say? Comment here: bit.ly/OyCd3M
AaronBartell.com


Read the original at Young i Perspectives.

Categories: Blogs Tags: , , , , ,

Simply 'i' › PHP i5_Toolkit from Aura Equipments and the QSYSOPR messages

August 22nd, 2012 Comments off
One of the questions we are being asked regularly is why am I getting messages in the QSYSOPR message queue when using the i5_toolkit from Aura. The answer is very simple, before Zend upgraded to their latest version (5.6) they had an agreement with Aura equipments for the use and support of the i5_toolkit. Since [...]


Read the original at Simply 'i'.

Simply 'i' › Adding CGI capabilities to iAMP

June 15th, 2012 Comments off
We have been working with a client who wanted to be able to install a new website on their IBMi. The new website was developed on another OS using cake PHP by a development company that had no idea about how to set up a web server on an IBMi so we were asked to [...]


Read the original at Simply 'i'.

Simply 'i' › PHP ZipCode to TimeZone

May 30th, 2012 Comments off
I have been building a database of customers to call and found one slight issue, I needed to be able to workout which timezone each of the contacts are in so I only call when its suitable for them! I started off by using one of the online ZipCode to TimeZone converters and manually adding [...]


Read the original at Simply 'i'.

Simply 'i' › Zend moves support for ZendDBi to alternative supplier.

May 15th, 2012 Comments off
A recent article in IT Jungle just announced that Zend is going to be moving support and future development for Zend DBi off to another supplier. I did a quick review of the website for Percona and the pricing for their support for MySQL and various add-ons they have created and found the following price [...]


Read the original at Simply 'i'.

Simply 'i' › New features we are working on for HA4i

April 3rd, 2012 Comments off
Things are still changing and we are releasing updates to the HA4i product on a regular basis. As customers use the products they ask for changes to existing processes or ask for new ones to be added, we are also always looking for better ways to carry out some of the tasks already built into [...]


Read the original at Simply 'i'.

css.php