English 中文(简体)
每一段2:同时使用准点和上载方法处理错误
原标题:perl Apache2::Request errors using param() and upload() methods simultaneously

I m coding in a mod_perl environment and using theache2:Requestructic to access data. 除我还使用Appa2: :Request也反对上载档案/目标文件。 如果分别使用这些方法,则不存在问题。 然而,如果我在同一次路程中使用这些错误,我就把这一错误列入我的阿帕奇记录:

[notice] child pid 27383 exit signal Segmentation fault (11)

我的守则是:

my $r = shift;
use Apache2::Request;
use Apache2::Upload;
my $req = Apache2::Request->new($r, POST_MAX => 10 * 1024 * 1024,DISABLE_UPLOADS => 0);
my $img_url = $req->param( url );

my $upload = $req->upload( files[] );
my $filename = $upload->filename;
my $upload_filehandle = $upload->fh;
my $file_size = $upload->size;

阿帕奇2:上载是因为它被帕帕帕特2使用:Request。 和我一样,如果我对从“米美元_升温”开始的线路或上载部分进行评论,则该行将进行罚款。 然而,如果两者都出现在法典中,我就获得了502个Proxy Error,而这种差错出现在pache记录中。

提前感谢!

最佳回答

我对此表示赞赏,这是一个老问题,因此,我的回答是很晚的,但是,如果有人 else倒这个read子,我确实有解决办法。

问题与新(新)相比,是 mo的_。

my $req = Apache2::Request->New($r);

(就你而言,你在那里还有其他几个问题,但我所看到的是同样的ault和零星症状。)

阿帕奇2:当盘点美元时,就要求进行点击,但有时甚至当你把@_转换成美元时,似乎也会发生点击(如你所做的那样)。 我可以解释为什么会发生这种情况,但我发现一个简单的改变,阻止了这一问题的发生:

my $req = Apache2::Request->New(Apache2::RequestUtil->request);

因此,你的法典大致如下:

my $req = Apache2::Request->new(Apache2::RequestUtil->request,
                                POST_MAX => 10 * 1024 * 1024,
                                DISABLE_UPLOADS => 0);
问题回答

暂无回答




相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...

热门标签