IPC::Open3 Fails Running Under Apache
Posted
by rjray
on Stack Overflow
See other posts from Stack Overflow
or by rjray
Published on 2010-01-19T21:30:02Z
Indexed on
2010/04/12
1:03 UTC
Read the original article
Hit count: 597
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:
Cannot fdopen STDOUT: Invalid argument
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.
© Stack Overflow or respective owner