首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >perl: IPC::Open3未能使用FCGI打开STDERR

perl: IPC::Open3未能使用FCGI打开STDERR
EN

Stack Overflow用户
提问于 2013-07-18 06:43:56
回答 1查看 569关注 0票数 4

我用我的fcgi脚本测试了Git::存储库。我既不能创建git对象,也不能使用该模块运行任何git命令。IPC::open3 3::open3出错:

不是/usr/local/lib/perl/5.10.1/FCGI.pm第125行的GLOB引用

我在FCGI::OPEN()中添加了一个cluck,在IPC::Open3::xopen()中添加了一个警告,下面是我得到的内容:

代码语言:javascript
复制
mod_fcgid: stderr: IPC::Open3::xopen() called with args: GLOB(0xe92360) <&=5 
mod_fcgid: stderr: IPC::Open3::xopen() called with args: GLOB(0xe92438) >&=9 
mod_fcgid: stderr: IPC::Open3::xopen() called with args: GLOB(0xe92498) >&=12 
mod_fcgid: stderr: FCGI::OPEN() called with args: FCGI::Stream=SCALAR(0x14e43f0) >&=12 
mod_fcgid: stderr:  at /usr/local/lib/perl/5.10.1/FCGI.pm line 125 
mod_fcgid: stderr: \tFCGI::Stream::OPEN('FCGI::Stream=SCALAR(0x14e43f0)', '>&=12') called at /usr/share/perl/5.10/IPC/Open3.pm line 67 
mod_fcgid: stderr: \tIPC::Open3::xopen('GLOB(0xe92498)', '>&=12') called at /usr/share/perl/5.10/IPC/Open3.pm line 162 
mod_fcgid: stderr: 
mod_fcgid: stderr: \tIPC::Open3::_open3('open3', 'MyModule', 'GLOB(0x1a56078)', 'GLOB(0x1906738)', 'GLOB(0x12f5430)' , '/usr/bin/git', '--version') called at /usr/share/perl/5.10/IPC/Open3.pm line 233 
mod_fcgid: stderr: \tIPC::Open3::open3('GLOB(0x1a56078)', 'GLOB(0x1906738)', 'GLOB(0x12f5430)', '/usr/bin/git', '--version') called at /usr/local/lib/site_perl/MyModule.pm line 113

只有在STDERR打开时才调用FCGI::OPEN()。STDIN和STDOUT没有到达FCGI::OPEN()。我查看了IPC::Open3,这是它失败的地方:

代码语言:javascript
复制
if ($dad_rdr ne $dad_err) {
    if ($dup_err) {
        # I have to use a fileno here because in this one case
        # I'm doing a dup but the filehandle might be a reference
        # (from the special case above).
        xopen \*STDERR, ">&" . xfileno($dad_err)
            if fileno(STDERR) != xfileno($dad_err);
    } else {
        xclose $dad_err;
        xopen \*STDERR, ">&=" . fileno $kid_err;  # this is failing
    }
} else {
    xopen \*STDERR, ">&STDOUT" if fileno(STDERR) != fileno(STDOUT);
}

我可以用IPC::Run::start代替open3,一切都很好。但我真的很想了解STDERR到底出了什么问题。是FCGI.pm或Open3.pm的错误,还是我做错了什么?

我正在运行Apache2.2.16,在debian压缩程序上使用li浸ache2-mod-fcgid 1:2.3.6、libfcgi-perl 0.71-1和libcgi-fast 5.10.1。Perl版本为5.10.1。

如何复制:

代码语言:javascript
复制
use CGI::Fast;
use Symbol ();
use IPC::Open3 qw(open3);

while (my $cgi = new CGI::Fast) {
    my $pid;
    my $in  = Symbol::gensym;
    my $out = Symbol::gensym;
    my $err = Symbol::gensym;    

    $pid = open3( $in, $out, $err, '/usr/bin/git', '--version');

}
EN

回答 1

Stack Overflow用户

发布于 2013-07-26 15:56:07

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17716363

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档