从PHP调用RPG程序
我们有 AS/400 系统。我被要求寻找一种在我们的 Apacher 服务器上从 PHP 调用 RPG 程序的方法。我找到的唯一解决方案是将 zend 服务器安装到 AS/400 并使用 i5 PHP API Toolkit。由于我不知道如何使用 AS/400 并且没有访问权限,所以我还没有尝试过。
我们可以连接到数据库并从 php 读取、写入。我问是否有任何方法可以从 php 代码调用我们系统上的 rpg 程序并发送参数,检索输出。
我发现有 JTOpen for Java。也许对于 Php 来说同样的事情也可以。
We have an AS/400 system. I am asked to look for a way to call RPG programs from PHP on our Apacher server. The only solution i found was installing zend server to AS/400 and using i5 PHP API Toolkit. Since I don't know how to use AS/400 and don't have access i haven't tried it yet.
We can connect to database and read, write from php. I am asking if there is any way to call a rpg program on our system from php code and send parameters, retrieve output.
I found there is JTOpen for Java. Maybe same thing for Php would work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以像执行存储过程一样执行主机程序。
欲了解更多信息:
iSeries 访问 ODBC:存储过程
You can execute host programs as if they were stored procedures.
For more information:
iSeries Access ODBC: Stored Procedures
如今,最简单的答案是随 Zend Server 一起提供的开源 PHP Toolkit for IBM i可以免费下载。
Today the easiest answer is the open-source PHP Toolkit for IBM i that is shipped with Zend Server and also is available for free download.
我不是 iSeries 开发人员,因此无法提供详细说明,但应该可以使用 CGIDEV2 库 (http://en.wikipedia.org/wiki/Cgidev2) 通过 HTTP 公开 RPG 功能。这将使 PHP 和任何其他可以充当 Web 客户端的环境轻松访问您的 RPG 功能。需要注意的是,您需要对相关 RPG 进行源代码级别修改,这可能不适合您的工作安排。
编辑:抱歉,我刚刚注意到您说您无法直接访问 iSeries,所以这不是您的解决方案,
I'm not an iSeries developer so I can't give detailed instructions but it should be possible to use the CGIDEV2 library (http://en.wikipedia.org/wiki/Cgidev2) to expose RPG functionality over HTTP. This would make your RPG functionality easily accessible to PHP and any other environment which can act as a web client. The caveat is that you need to make source level modifications to the RPG in question which may not suit your working arrangements.
Edit: Sorry, I just noticed that you said you didn't have access to the iSeries directly so this won't be a solution for you,