Link to home
Start Free TrialLog in
Avatar of gmanpert
gmanpert

asked on

Perl web form submit gets file download window rather than form execution and display

First, this may not be a purely PERL question.
We recently updated our PERL software on our LAMP (Linux, Apache, MySQL, Perl) system.
Subsequently, a form which had been working great (and the code has not been changed)
Now, instead of executing, when a user clicks on the submit button, it pops up a window asking the user if they want to open the perl program with the PERL command line interpreter.

Any ideas what might need changing to resolve this?

Stumped.

-G
ASKER CERTIFIED SOLUTION
Avatar of Adam314
Adam314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gmanpert
gmanpert

ASKER

Here is where I'm at:

> Did your apache httpd.conf change at all?  

  Anything is possible but most likely no.

> Do you have the ExecCGI option turned on for the directory the script is in?

Here are my Apache Settings in my httpd.conf file:

 ScriptAlias /fperl "/www/htdocs/frms/fperl"
  <Directory "/www/htdocs/frms/fperl">
        AllowOverride None
        SetHandler cgi-script
        AddHandler cgi-script .PL .pl
        Options +ExecCGI -Includes
        Order allow,deny
        Allow from all
    </Directory>

<Files "/www/htdocs/frms/fperl/simple.pl">
 AllowOverride None
 Options ExecCGI
 SetHandler cgi-script
</Files>

Here is simple.pl script:

#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print"<tt>\n";
foreach $key (sort keys(%ENV)) {
 print "$key = $ENV{$key}<p>";
}

Do you have the execute bit set for the webserver user?

 The simple.pl script is owned by wwwrun with group www and is readable and executable by User, Group, and World.

Trying to view http://mydomain/fperl/simple.pl

Still gets me a pop-up window with the text, "Opening simple.pl.  You have chosen to open simple.pl which is a PL file from http://mydomain  What should Firefox do with this file?"

I'm sure I am just missing something obvious, but I'm not sure what.

-G
Also, the simple.pl script works fine on another server... so you can definitely eliminate that as the source of the problem.

Basically, something is not turned on properly for CGI.  Just not sure what?

-g
I should mention that mod_perl is loaded, mod_perl.so is where it should be. So that isn't the problem either.
Finally, resolved this.  Apparently, once we updated Apache and PERL on our servers one needs to use this configuration:

 ScriptAlias /fperl "/www/htdocs/frms/fperl"
  <Directory "/www/htdocs/frms/fperl">
        AllowOverride None
        SetHandler perl-script
        PerlResponseHandler ModPerl::PerlRun
        PerlOptions +ParseHeaders
        Options +ExecCGI
#        AddHandler perl-script .PL .pl
        Order allow,deny
        Allow from all
    </Directory>

Thanks for the insights!