开发者

perl page not read as perl

I am trying to run this script

mail.pl

#!/usr/bin/perl

print "Content-type: text/html \n\n"; #HTTP HEADER

#CREATE
$email = "pt-desu\@*****-****.com";

#PRINT
print "$email<br />";

The file could be accessed via 开发者_StackOverflow中文版http://mysite.com/p/cgi-bin/mail.pl but when you go there the browser proms to download the file and does not display anything


Your webserver isn't set up to process *.pl files as Perl; it's instead just serving them up as plain-text. Consult your webserver's documentation for setting this up.

For Apache, try consulting this tutorial. The key bits are:

AddHandler cgi-script .cgi .pl

and

<Directory />
  Options FollowSymLinks
  AllowOverride None
</Directory>

and

Options FollowSymLinks +ExecCGI

...in your httpd.conf file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜