Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

problems with switching off params::validate in mod_perl

by david2008 (Scribe)
on Jun 18, 2014 at 12:39 UTC ( [id://1090302]=perlquestion: print w/replies, xml ) Need Help??

david2008 has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I am using params::validate and want to switch it off in production where i use it with apache httpd and mod_perl.
I set in the .cshrc.config PERL_NO_VALIDATION to 1.
Afterwards in the local_httpd.config i use PassEnv PERL_NO_VALIDATION
The parameter is passed well as i can verify it with warn $ENV{PERL_NO_VALIDATION}.

Unfortunately i get the error:
The 'x' parameter (undef) to Y::foo was an 'undef', which is not one o +f the allowed types: scalar at Y.pm line 70. ... ModPerl::ROOT::ModPerl::Registry::z_2ecgi::handler('Apache2::Reque +stRec=SCALAR(0xb61b6a8)') called at ... eval {...} called at ... ModPerl::RegistryCooker::run('ModPerl::Registry=HASH(0xb6360c8)') +called at ... ModPerl::RegistryCooker::default_handler('ModPerl::Registry=HASH(0 +xb6360c8)') called at ... ModPerl::Registry::handler('ModPerl::Registry', 'Apache2::RequestR +ec=SCALAR(0xb61b6a8)') called at -e line 0 eval {...} called at -e line 0
When i run the same cgi through command line everything works fine.
What is wrong here?
Thanks,
David

Replies are listed 'Best First'.
Re: problems with switching off params::validate in mod_perl
by Corion (Patriarch) on Jun 18, 2014 at 12:42 UTC

    You don't show us the relevant code, so we don't know if there is an error in your program logic.

    My guess is that you didn't restart the (correct instance of) Apache webserver and it still has an old version of the environment where PERL_NO_VALIDATION is not set.

    Note that the environment of the Apache webserver may well be different from your login environment as normal user.

    Personally, I would look at setting that environment variable in the HTTP configuration for your script/website instead of setting it globally for the Apache user.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-24 10:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found