Seiden Group
Modern Development & Open Source for IBM i
  • Link to LinkedIn
  • Link to Mail
  • Home
  • Seiden PHP+
    • Seiden PHP+
    • Install & Learn
    • SmartSupport
    • PHP Migrations & Upgrades
    • Success Stories
    • Free PHP Assessment
    • Documentation
    • What’s New (Changelog)
  • IBM i Services
    • Development
    • Training & Mentoring
    • Open Source Setup & Upgrades
    • SSL/TLS Install & Learn
    • Performance
  • Support
    • Open Source & PHP
    • VS Code for i
    • Developer Support
    • Support Success Stories
  • VS Code for i
    • Support
    • Training
    • Code for i Resource Guide
    • Getting Started Videos
    • Code for IBM i Fridays
  • Free Stuff
    • IBM i Strategy & Tips
    • PHP Upgrade Assessment
    • CNX Valence Assessment
    • VS Code for IBM i Resources
    • Code for IBM i Fridays
    • QCachegrind Download
    • PHP Toolkit for IBM i Resources
    • Qshell on i Library
  • Blog
  • About
    • About Our Team
    • About Alan Seiden
    • Speakers & Sessions
    • In the News
  • Contact
  • 201.447.2437
  • Search
  • Menu Menu

PHP Toolkit for IBM i Resources

PHP Toolkit for IBM iConnect your PHP applications to resources such as RPG and COBOL on your IBM i using the open source PHP Toolkit for IBM i.

Co-developed by Alan Seiden, the toolkit used to be known as the XML Toolkit because XML is used internally.

It has some unique features and is free and open source.

Where to find the PHP Toolkit

  • You probably already have it!
  • PHP Toolkit (front end)
    • On IBM i, it is automatically installed with both Seiden PHP+ and Zend Server
    • Or…download from https://github.com/zendtech/IbmiToolkit
    • Or…install via Composer (“composer require zendtech/ibmitoolkit”)
  • XMLSERVICE (back end for the toolkit)
    • Comes pre-installed by IBM in the QXMLSERV library
    • To view its source code: https://github.com/IBM/xmlservice

Sample scripts, options, and other resources

  • Toolkit Usage Examples (more are added regularly)
  • Data Types for XMLSERVICE and the PHP Toolkit
  • Calling Procedures and Service Programs with the PHP Toolkit for IBM i

Support

  • Community support through Github issues
  • Professional toolkit support through Seiden Group PHP SmartSupport
22 replies
  1. Angel
    Angel says:
    May 13, 2022 at 3:05 pm

    To work with PHP what exactly do I need to download and install on System i and on Windows?

    What configuration manuals or examples can help me?

    Thanks for your help.

    Reply
    • Alan Seiden
      Alan Seiden says:
      May 13, 2022 at 10:18 pm

      Angel, if you run PHP on Windows, I’d suggest installing the PHP Toolkit using the “install via Composer” instructions above, or by copying the code down from Github. The toolkit is just PHP code. Nothing needs to be installed on the IBM i. Connect using the PDO_ODBC transport option, as shown in one of the sample scripts (linked above).

      Reply
  2. Erica
    Erica says:
    February 23, 2022 at 4:56 pm

    We are using the iToolkitService.php to call an RPG service program to retrieve data for a simple PHP display. Recently, we switched that RPG service program from an outside purchased http post procedure to the IBM http sql functions, in this case HTTPGETCLOBVERBOSE. The XMLSERVICE job is no longer returning the needed data, and there are various sql and java errors in the logs.
    JVAB309
    User-defined function error on member QSQPTABL. SQLSTATE 58004.
    SQL4301 Java interpreter startup or communication failed for reason code 1.

    Is there another parameter I should be using here?

    $obj = ToolkitService::getInstance($system, $user, $pwd);
    $obj->setToolkitServiceParams(array(‘InternalKey’=>”/tmp/$user”));

    Reply
    • Alan Seiden
      Alan Seiden says:
      February 23, 2022 at 5:50 pm

      Hi, Erica, I’ll contact you offline, then we’ll post the answer here later.

      Reply
      • Alan Seiden
        Alan Seiden says:
        March 30, 2022 at 9:52 am

        For anyone reading Erica’s question above, the issue had to do with the Java environment. She ended up rewriting some of the functionality to not need the HTTP SQL functions (Java underneath). There is an alternative now, however, available in TR5 (https://www.ibm.com/support/pages/ibm-i-74-tr5-enhancements), a new set of HTTP functions that do not need Java to run (https://www.ibm.com/support/pages/node/6486889) that would avoid any issues related to the JVM environment.

        Reply
  3. Isabelle Carmier
    Isabelle Carmier says:
    December 1, 2021 at 2:53 am

    Hello Alan,
    I have a problem with a CLLE that I am calling with a pgmcall.
    In this program I run sql on PF (create, insert, delete….).
    It works fine on our as400 but when I call it via php nothing seems to have been executed.
    Would you have encountered this problem?
    Regards

    Reply
    • Alan Seiden
      Alan Seiden says:
      February 23, 2022 at 5:48 pm

      Hi, Isabelle, I’d guess there’s an error somewhere in the program call. I suggest you create and inspect a debug log to find out: https://github.com/zendtech/IbmiToolkit/blob/e5c6ee712d530c272c648e56ff18b7b32cecb0a0/samples/options.php#L48

      Contact me offline with details of the debug log if you want to.

      Reply
  4. Jason Lewis
    Jason Lewis says:
    November 17, 2021 at 12:06 pm

    If XMLSERVICE is installed and setup on the IBMi with an apache instance could the PHP Toolkit be used on another webserver such as windows?

    Would the only requirement be that the toolkit PHP need to be placed on the windows webserver?
    I see with Zendserver for windows they have the toolkit plugin, but we are looking for a cheaper (or free) solution for the hosting.

    We are looking to keep the web server hosting for the front facing pages off the IBMi but use the toolkit functions for the ease of use of IBMi resources like program calls ect.

    Reply
    • Alan Seiden
      Alan Seiden says:
      November 17, 2021 at 12:14 pm

      Hi, Jason, that’s correct. XMLSERVICE comes pre-installed in QXMLSERV these days. You’d only need to install the toolkit PHP with your front-end code (in your case, a Windows server). Choose a “transport” that can connect to the IBM i without needing a license. PDO_ODBC or odbc or HTTP would be good options. Let us know if you need any help. Alan

      Reply
  5. Brian Zeuske
    Brian Zeuske says:
    October 28, 2020 at 5:55 pm

    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

    Reply
    • Alan Seiden
      Alan Seiden says:
      October 28, 2020 at 8:59 pm

      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

      Reply
  6. Alessandro Scolavino
    Alessandro Scolavino says:
    October 17, 2018 at 8:35 am

    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?

    Reply
    • Alan Seiden
      Alan Seiden says:
      October 31, 2018 at 6:35 pm

      Alessandro, no limitations. You probably need to set a higher plugSize.

      Reply
  7. Avrohom Notik
    Avrohom Notik says:
    July 19, 2017 at 2:29 am

    If You have problems with passing parameters, just write to database file, and the target program will read it. Just as simple as that.

    Reply
  8. Praveen
    Praveen says:
    May 26, 2016 at 6:51 am

    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,

    Reply
    • Alan Seiden
      Alan Seiden says:
      May 31, 2016 at 10:43 am

      Praveen, are you connecting from a PC?

      Reply
  9. Alan Seiden
    Alan Seiden says:
    February 11, 2014 at 12:28 am

    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

    Reply
    • Alan Seiden
      Alan Seiden says:
      May 31, 2016 at 10:38 am

      Full support for PCML was added as of toolkit 1.6.

      Reply
  10. Klaus-Peter Luttkus
    Klaus-Peter Luttkus says:
    February 10, 2014 at 8:30 am

    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

    Reply
    • Alan Seiden
      Alan Seiden says:
      November 17, 2021 at 12:29 pm

      Hi, Klaus-Peter, PCML support exists for the Compatibility Wrapper (CW) only. Do you still need it? Let us know.

      Reply
  11. Barbara Fullenwider
    Barbara Fullenwider says:
    July 25, 2013 at 11:36 am

    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

    Reply
    • Alan Seiden
      Alan Seiden says:
      November 17, 2021 at 12:26 pm

      Hi, Barbara, we’ve written an example of multi-occurrence parameters here: https://github.com/zendtech/IbmiToolkit/blob/master/samples/data-structure-array-with-counter.php

      Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

22 replies
  1. Angel
    Angel says:
    May 13, 2022 at 3:05 pm

    To work with PHP what exactly do I need to download and install on System i and on Windows?

    What configuration manuals or examples can help me?

    Thanks for your help.

    Reply
    • Alan Seiden
      Alan Seiden says:
      May 13, 2022 at 10:18 pm

      Angel, if you run PHP on Windows, I’d suggest installing the PHP Toolkit using the “install via Composer” instructions above, or by copying the code down from Github. The toolkit is just PHP code. Nothing needs to be installed on the IBM i. Connect using the PDO_ODBC transport option, as shown in one of the sample scripts (linked above).

      Reply
  2. Erica
    Erica says:
    February 23, 2022 at 4:56 pm

    We are using the iToolkitService.php to call an RPG service program to retrieve data for a simple PHP display. Recently, we switched that RPG service program from an outside purchased http post procedure to the IBM http sql functions, in this case HTTPGETCLOBVERBOSE. The XMLSERVICE job is no longer returning the needed data, and there are various sql and java errors in the logs.
    JVAB309
    User-defined function error on member QSQPTABL. SQLSTATE 58004.
    SQL4301 Java interpreter startup or communication failed for reason code 1.

    Is there another parameter I should be using here?

    $obj = ToolkitService::getInstance($system, $user, $pwd);
    $obj->setToolkitServiceParams(array(‘InternalKey’=>”/tmp/$user”));

    Reply
    • Alan Seiden
      Alan Seiden says:
      February 23, 2022 at 5:50 pm

      Hi, Erica, I’ll contact you offline, then we’ll post the answer here later.

      Reply
      • Alan Seiden
        Alan Seiden says:
        March 30, 2022 at 9:52 am

        For anyone reading Erica’s question above, the issue had to do with the Java environment. She ended up rewriting some of the functionality to not need the HTTP SQL functions (Java underneath). There is an alternative now, however, available in TR5 (https://www.ibm.com/support/pages/ibm-i-74-tr5-enhancements), a new set of HTTP functions that do not need Java to run (https://www.ibm.com/support/pages/node/6486889) that would avoid any issues related to the JVM environment.

        Reply
  3. Isabelle Carmier
    Isabelle Carmier says:
    December 1, 2021 at 2:53 am

    Hello Alan,
    I have a problem with a CLLE that I am calling with a pgmcall.
    In this program I run sql on PF (create, insert, delete….).
    It works fine on our as400 but when I call it via php nothing seems to have been executed.
    Would you have encountered this problem?
    Regards

    Reply
    • Alan Seiden
      Alan Seiden says:
      February 23, 2022 at 5:48 pm

      Hi, Isabelle, I’d guess there’s an error somewhere in the program call. I suggest you create and inspect a debug log to find out: https://github.com/zendtech/IbmiToolkit/blob/e5c6ee712d530c272c648e56ff18b7b32cecb0a0/samples/options.php#L48

      Contact me offline with details of the debug log if you want to.

      Reply
  4. Jason Lewis
    Jason Lewis says:
    November 17, 2021 at 12:06 pm

    If XMLSERVICE is installed and setup on the IBMi with an apache instance could the PHP Toolkit be used on another webserver such as windows?

    Would the only requirement be that the toolkit PHP need to be placed on the windows webserver?
    I see with Zendserver for windows they have the toolkit plugin, but we are looking for a cheaper (or free) solution for the hosting.

    We are looking to keep the web server hosting for the front facing pages off the IBMi but use the toolkit functions for the ease of use of IBMi resources like program calls ect.

    Reply
    • Alan Seiden
      Alan Seiden says:
      November 17, 2021 at 12:14 pm

      Hi, Jason, that’s correct. XMLSERVICE comes pre-installed in QXMLSERV these days. You’d only need to install the toolkit PHP with your front-end code (in your case, a Windows server). Choose a “transport” that can connect to the IBM i without needing a license. PDO_ODBC or odbc or HTTP would be good options. Let us know if you need any help. Alan

      Reply
  5. Brian Zeuske
    Brian Zeuske says:
    October 28, 2020 at 5:55 pm

    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

    Reply
    • Alan Seiden
      Alan Seiden says:
      October 28, 2020 at 8:59 pm

      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

      Reply
  6. Alessandro Scolavino
    Alessandro Scolavino says:
    October 17, 2018 at 8:35 am

    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?

    Reply
    • Alan Seiden
      Alan Seiden says:
      October 31, 2018 at 6:35 pm

      Alessandro, no limitations. You probably need to set a higher plugSize.

      Reply
  7. Avrohom Notik
    Avrohom Notik says:
    July 19, 2017 at 2:29 am

    If You have problems with passing parameters, just write to database file, and the target program will read it. Just as simple as that.

    Reply
  8. Praveen
    Praveen says:
    May 26, 2016 at 6:51 am

    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,

    Reply
    • Alan Seiden
      Alan Seiden says:
      May 31, 2016 at 10:43 am

      Praveen, are you connecting from a PC?

      Reply
  9. Alan Seiden
    Alan Seiden says:
    February 11, 2014 at 12:28 am

    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

    Reply
    • Alan Seiden
      Alan Seiden says:
      May 31, 2016 at 10:38 am

      Full support for PCML was added as of toolkit 1.6.

      Reply
  10. Klaus-Peter Luttkus
    Klaus-Peter Luttkus says:
    February 10, 2014 at 8:30 am

    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

    Reply
    • Alan Seiden
      Alan Seiden says:
      November 17, 2021 at 12:29 pm

      Hi, Klaus-Peter, PCML support exists for the Compatibility Wrapper (CW) only. Do you still need it? Let us know.

      Reply
  11. Barbara Fullenwider
    Barbara Fullenwider says:
    July 25, 2013 at 11:36 am

    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

    Reply
    • Alan Seiden
      Alan Seiden says:
      November 17, 2021 at 12:26 pm

      Hi, Barbara, we’ve written an example of multi-occurrence parameters here: https://github.com/zendtech/IbmiToolkit/blob/master/samples/data-structure-array-with-counter.php

      Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

SUBSCRIBE
Open Thinking
Monthly IBM i Strategy & Tips
  • This field is for validation purposes and should be left unchanged.

Recent Posts

  • Mitigating the eMudhra Intermediate CA Compromise with IBM i
  • Critical Security Update Available in Seiden PHP+ Server
  • Moving to IBM i 7.6? An SDA Alternative with VS Code and IBM Bob
  • What’s New with Mapepire Database Connector for IBM i
  • Do You Need IBM i Observability?

SEIDEN GROUP: Modern Development & Open Source for IBM i

Home   |   Seiden PHP+   |   IBM i Services  |   Support   |   VS Code for i   |   Free Stuff   |   Blog  |   Privacy Policy  |   Contact         201.447.2437

© 2026 Seiden Group, LLC
  • Link to LinkedIn
  • Link to Mail
Scroll to top Scroll to top Scroll to top