You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Aleksey Zvyagin <za...@ping.ru> on 2000/11/20 15:08:54 UTC

Embperl - stdout ?

Hello!

I have one problem:

I execute the Embperl from FastCGI:

 HTML::Embperl::XS_Init (1, $ENV{EMBPERL_LOG}, 1);
 my $rc = HTML::Embperl::Execute ({ inputfile  => $file, fdat=>$ref_fdat,
ffld=>$ref_ffld, mtime=>1, options=>(HTML::Embperl::optDisableFormData +
32)});

This code is working fine from shell command (it outputs HTTP headers & HTML
entity to stdout) but from FastCGI script all stdout output is not printed!
(apache logs a "incomplete headers"). May be problem is from dupping STDOUT
descriptor ?

But If i call:
 HTML::Embperl::XS_Init (1, $ENV{EMBPERL_LOG}, 1);
my $output;
 my $rc = HTML::Embperl::Execute ({ inputfile  => $file, fdat=>$ref_fdat,
ffld=>$ref_ffld, mtime=>1, output=>\$output,
options=>(HTML::Embperl::optDisableFormData + 32)});
print $output;

then it works Ok

Please help me a solution of this problem.

Sorry for my bad English ;-)

---
Best regards, Aleksey Zvyagin, zal@ping.ru


Re: Embperl - stdout ?

Posted by Gerald Richter <ri...@ecos.de>.
 Hello!
>
> I have one problem:
>
> I execute the Embperl from FastCGI:
>
>  HTML::Embperl::XS_Init (1, $ENV{EMBPERL_LOG}, 1);
>  my $rc = HTML::Embperl::Execute ({ inputfile  => $file, fdat=>$ref_fdat,
> ffld=>$ref_ffld, mtime=>1, options=>(HTML::Embperl::optDisableFormData +
> 32)});
>
> This code is working fine from shell command (it outputs HTTP headers &
HTML
> entity to stdout) but from FastCGI script all stdout output is not
printed!

Embperl use C level output, not Perl level output functions, FastCGI
redirects the Perl output to his own routines. To get the same result for
the C level, you have to link with a special stdio library and include the
corresponding header file. I don't run FastCGI, so didn't tried to do so,
but I would be very happy if Embperl works with FastCGI. So if you like to
give it a try, I would help you as good as I can.

>
> Sorry for my bad English ;-)
>

Oh, it's isn't bad, at least not more bad as my own bad english ;-)

Gerald


-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------