将 PHP 连接到 IBM i (AS/400)

2022-01-14 00:00:00 database odbc db2 ibm-midrange php

我有一个即将进行的项目,我需要将我们的网站 (PHP5/Apache 1.3/OpenBSD 4.1) 连接到我们在 OS400 V5R3 的 iSeries 上运行的后端系统,以便我可以访问存储在那里的一些表.我做了一些检查,但遇到了一些障碍.

I've got an upcoming project wherein I will need to connect our website (PHP5/Apache 1.3/OpenBSD 4.1) to our back-end system running on an iSeries with OS400 V5R3 so that I can access some tables stored there. I've done some checking around but am running into some roadblocks.

据我所知,IBM 的 DB2 扩展和 DB2 软件只能在 Linux 下运行.我尝试使用 IBM 的所有软件编译扩展,甚至尝试了他们的预编译 ibm_db2 扩展,但没有成功.IBM 只支持 Linux,所以我在内核中打开了 Linux 仿真,但这似乎没有任何帮助.

From what I've seen the DB2 extensions and DB2 software from IBM only run under Linux. I've tried compiling the extensions with all the software from IBM and even tried their precompiled ibm_db2 extension with no luck. IBM only supports Linux so I turned on the Linux emulation in the kernel but that didn't seem to help anything.

如果有人遇到过让一切都在 OpenBSD 下以本机方式运行,那就太好了,但我想我可能需要做的是设置第二台运行 CentOS 并安装了 DB2 的服务器(很可能通过 ZendCore for IBM,因为看起来为我做这一切)和驱动程序,这样我就可以设置一个小型事务服务器,我可以对它进行发布并获得我需要的 DB2 数据的 JSON 表示.

If anyone has run across getting everything to run natively under OpenBSD that would be great, but what I think I may have to do is setting up a second server running CentOS with DB2 installed (most likely via ZendCore for IBM since it seems to do all this for me) and the driver so that I can set up a small transaction server that I can post against and get a JSON representation of the DB2 data that I need.

第二个选项是不是有点过头了,还是其他人有更好的想法?

Does the second option seem overkill or does anyone else have any better ideas?

推荐答案

你有没有看过使用 unixODBC?如果我没记错的话,它支持 IBM DB2 并在 OpenBSD 上编译.查看 http://www.php.net/odbc 了解有关 PHP 方面的更多信息.

Have you looked at connecting to the server using unixODBC? If I remember correctly it has support for IBM DB2 and compiles on OpenBSD. Check out http://www.php.net/odbc for more information regarding the PHP side.

如果您不能让它工作,那么您可以选择在 Linux 服务器上设置 Web 服务.

If you can't get that to work, the option to setup a web service on a Linux server may be all you can do.

相关文章