On 3 Mar 2004 at 10:20, Ben Russell wrote:
> I have a simple script that I was trying to convert to a executable file (using pp)
> and use in my web browser as a CGI script. The script is as follows (script.pl):
>
> --------------------------------------------------------------------------------
>
> #!/usr/bin/perl
>
> print "Content-type: text/html\n\n";
> print "Test script";
>
> --------------------------------------------------------------------------------
>
>
> However, when I use 'pp -o script.exp script.pl', and upload it to my server (I
> chose the .exp extension so that it would not download the file as a .exe). I have
> the following configured in Apache (httpd.conf):
>
> --------------------------------------------------------------------------------
>
> AddHandler cgi-script .cgi .pl .exp
>
> --------------------------------------------------------------------------------
>
>
> So that it will try to run the 'script.exp' file like a Perl script. However, when I
> try to run this script through my browser, it won't work (gives me a 500 Internal
> Server Error).
> I am running Red Hat Linux 7.3, Apache 1.3, and Perl 5.6.1. Any help would be
> appreciated. Thanks.
What you generated was an .exe, no matter what you call it, and if you want Apache to
invoke perl and run it, you need a perl script:
pp -P -o packed_script.pl script.pl
or
pp -P -o script.cgi script.pl
if Apache is treating .cgi as if it is perl stuff. Apache probably tried to get
perl.exe to run the binary script.exp and perl choked.
Alan Stewart