Connect your PHP applications to resources on your IBM i (evolved from AS/400, iSeries) using the open source (free!) PHP Toolkit for IBM i.
Co-developed by Alan Seiden and maintained by the IBM i community, the toolkit is also known as the XML Toolkit because the PHP front end and the XMLSERVICE RPG back end communicate via XML.
Start Here with Alan’s Presentation Slides
Get the most complete information about the PHP Toolkit by reading Alan’s presentation Bring RPG/COBOL Business Logic to the Web with the PHP Toolkit (PDF format). Note: these slides date from about 2017 and don’t reflect RPM-based PHP paths and other changes.
Install the PHP Toolkit
- XMLSERVICE (back end for the toolkit)
- Shipped by IBM in the QXMLSERV library
- Source code: https://github.com/IBM/xmlservice
- PHP Toolkit (front end)
- Ships with both Seiden CommunityPlus+ PHP and Zend Server
- Or…download from https://github.com/zendtech/IbmiToolkit
- Or…install via Composer (“composer require zendtech/ibmitoolkit”)
Hello Allan,
I’ve been working on a project converting net.data to php. For the most part, I’ve been having pretty good success. But every now and then I run into a snag. One such snag is with tool kit. In net.data, you can call a CL program directly from a net.data document that can create a workfile in qtemp that you can later run sql over in the same net.data document. I’m not able to do that in tool kit because it runs in a different job. So instead, I’m loading a multidimensional array using a prototype program. It works if I call the prototype program directly. But if I call a CL program in-between for the purpose of running an opnqry statement, the process errors. It seems to be working until it gets to the IPLUGR512K procedure.
Any thoughts?
Thank you,
Brian Zeuske
Hi, Brian, if you use stateless mode then the CL program would run in the same job as SQL, if called within the same PHP request, thus QTEMP should be fine. I get the impression that there is more to your question. It seems a little complicated for a comment on this page. Maybe you should email me with more details. — Alan
I tried xml toolkit but it seems it doesn’t support large query, i tried to fetch 10000 records and it generate an error on AS400, is there some limitation that you are aware of?
Alessandro, no limitations. You probably need to set a higher plugSize.
If You have problems with passing parameters, just write to database file, and the target program will read it. Just as simple as that.
I am trying to connect ibm iseries using zend framework 2 through localhost. I have configured database details in global.php now need to call stored procedure using database object. I have gone through the questions answered by you on stackoverflow but I am unable to do anything and I have blocked.
Can please help me in this,
Praveen, are you connecting from a PC?
Hi, Peter,
I’m working on a toolkit update to support PCML with PgmCall. Do you use PCML heavily?
PCML is currently supported only by the compatibility wrapper [CW], but because new projects should use the new toolkit API (PgmCall, etc.) instead of CW, I intend to add PCML support for PgmCall.
Tell me more about your requirements if you would like, perhaps through my contact page.
Best regards,
Alan
Full support for PCML was added as of toolkit 1.6.
Hello Alan, last year I attended one of your presentations on PHP on IBM i. Very interesting. I now have a problem with the API Toolkit, and so farI didn’t find any answers. Is there a way to declare parameters für the PgmCall method by way of using PCML? A short answer would be appreciated.
Regards from Germany
Peter
Could you recommend a site that explains and gives example of passing multi occurrence parameter to and RPG program and return parameters. We are stuck at work and do not know where to look