Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^5: apache + modperl problem

by jdrago_999 (Hermit)
on Mar 31, 2009 at 16:38 UTC ( [id://754460]=note: print w/replies, xml ) Need Help??


in reply to Re^4: apache + modperl problem
in thread apache + modperl problem

Did you try the simple test listed above? Does it still "not work?"

Are you getting error messages? What are they?

Can you post some code?

Replies are listed 'Best First'.
Re^6: apache + modperl problem
by scotbert (Initiate) on Apr 01, 2009 at 08:41 UTC
    Hi jdrago_999,

    Thanks for the reply.

    Yes, I did try the sample code and that all works fine. I am happy that my mod_perl/perl/Apache are all installed ok.

    My site works fine using HTML::Template. When I switch to use Template I get the error:
    [Wed Apr 01 09:28:54 2009] [crit] (22)Invalid argument: Parent: Failed + to create the child process. [Wed Apr 01 09:28:54 2009] [crit] (OS 6)The handle is invalid. : mast +er_main: create child process failed. Exiting. [Wed Apr 01 09:28:54 2009] [notice] Parent: Forcing termination of chi +ld process 2670888
    Everything works fine from the command-line, it just crashes when I run through apache.
    I have set up my site so that the template engine is swappable and am using HTML::Template::Filter::TT2; so that the templates are exactly the same between HTML::Template and Template::Toolkit
    Here is the working Template code for HTML::Template
    sub Render { my $proto = shift; my ($params, $data, $template, $base_template_dir) = @_; my $engine = HTML::Template::Expr->new(filter => \&ht_tt2_filter, filename => $base_templat +e_dir.'/'.$template, die_on_bad_params=>0, encoding => ':utf8'); $engine->param($params); $engine->param($data); print $engine->output; }
    Here is the corresponding code for Template::Toolkit which crashes
    sub Render { my $proto = shift; my ($params, $data, $template, $base_template_dir) = @_; my $tt = Template->new({INCLUDE_PATH => $base_template_dir, INTERPOLATE => 1}) || croak("$Template::ERROR\n"); $tt->process($template, { params => $params, data => $data } ); }
    and are called are called via
    $TEMPLATE_ENGINE->Render(@_, $TEMPLATE_DIR);
    where $TEMPLATE_ENGINE is the appropriate prototype.

    I'd appreciate any help you can give me.

    Thanks
      I found a 'fix'

      If I remove "INTERPOLATE => 1" from the initialiser it doesn't crash

        Yeah that's pretty strange.

        Have you taken a look at Apache2::ASP? Depending on what you're up to, it might feel a little more natural than *::Template::*

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://754460]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-24 03:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found