IPC :: Open3仍不成功在阿帕奇 [英] IPC::Open3 Fails Running Under Apache

查看:293
本文介绍了IPC :: Open3仍不成功在阿帕奇的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用IPC :: Open3(或IPC :: Open2,既表现出这种问题)调用外部二进制(在这种情况下bogofilter),并通过对儿童输入文件句柄给它一些输入的模块,然后读结果从子输出句柄。在大多数环境中运行时,code正常工作。然而,主要使用这种模块是阿帕奇2.2.6下运行的Web服务。而这环境下,我得到的错误:

I have a module that uses IPC::Open3 (or IPC::Open2, both exhibit this problem) to call an external binary (bogofilter in this case) and feed it some input via the child-input filehandle, then reads the result from the child-output handle. The code works fine when run in most environments. However, the main use of this module is in a web service that runs under Apache 2.2.6. And under that environment, I get the error:

无法fdopen STDOUT:无效的参数

Cannot fdopen STDOUT: Invalid argument

这只有当code Apache下运行的情况。 previously中,code构建一个可怕的复杂的命令,其中包括了在此文档的输入,并与后台蜱运行它。这工作,但非常缓慢,容易出现以独特的方式令人费解打破。我不想有恢复到旧版本,但我不能破解这个。

This only happens when the code runs under Apache. Previously, the code constructed a horribly complex command, which included a here-document for the input, and ran it with back-ticks. THAT worked, but was very slow and prone to breaking in unique and perplexing ways. I would hate to have to revert to the old version, but I cannot crack this.

推荐答案

难道是因为mod_perl的2关闭标准输出?我刚刚发现这一点,并发布了关于它:

Could it be because mod_perl 2 closes STDOUT? I just discovered this and posted about it:

http://marc.info/?l=apache-modperl&m=126296015910250&w=2

我认为这是一个讨厌的错误,但似乎没有人去关心它迄今。如果你的问题是相关的,你想它来引起别人的注意张贴在mod_perl的名单上的跟进。

I think it's a nasty bug, but no one seems to care about it thus far. Post a follow up on the mod_perl list if your problem is related and you want it to get attention.

乔恩

这篇关于IPC :: Open3仍不成功在阿帕奇的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆