开发者

How can I create and maintain sessions in series of Perl CGI scripts?

I am new to CGI-Perl and sessions. I have a problem running the following code.

I have four files 1. Session.html or Session.pm 2. name.pl 3. hobbies.pl 4. job.pl

The Session.pm is place in /var/www/html folder and the rest of the files are placed in /var/www/cgi-bin/session folder.

I have a basic html file(Session.html) which has a link to perl script it is giving the following error

[Mon Jan 04 14:21:24 2010] [error] [client ::1] Options ExecCGI is off in this directory: /var/www/html/name.pl, referer: http://localhost/Session.html
[Mon Jan 04 14:21:29 2010] [error] [client ::1] Options ExecCGI is off in this d开发者_运维知识库irectory: /var/www/html/name.pl, referer: http://localhost/Session.html
[Mon Jan 04 14:22:42 2010] [error] [client ::1] (13)Permission denied: exec of '/var/www/cgi-bin/session/name.pl' failed, referer: http://localhost/Session.pm
[Mon Jan 04 14:22:42 2010] [error] [client ::1] Premature end of script headers: name.pl, referer: http://localhost/Session.pm

Please help me out in executing the above example. Please give me the steps to be followed from the start.


... Options ExecCGI is off in this directory: /var/www/html/name.pl, ...

This error points to trying to run name.pl in /var/www/html/ instead of /var/www/cgi-bin/session/

Is the Session.html you posted correct because it doesn't seem to tally with this error?

... (13)Permission denied: exec of '/var/www/cgi-bin/session/name.pl' failed, ...

The name.pl cannot be run because it doesn't have execution rights set (on Linux/Unix you need to chmod a+x name.pl).


You may need to show what Session.pm does (it doesn't look like you using the CPAN module Session here).

On a general note I would consider simplifying what you doing down to a simple HTML & CGI script first and get that working. Then start looking into sessions etc.

Check out Ovid's CGI Tutorial for some sage advice on the Perl/CGI subject.

/I3az/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜