我对CGI和会话很陌生.我在运行以下代码时遇到了问题。
我有四个文件1. Session.html或Session.pm 2. name.pl 3. hobbies.pl 4. job.pl
Session.pm放在/var/www/html文件夹中,其余的文件放在/var/www/cgi/session文件夹中。
我有一个基本的html文件(Session.html),它有一个指向perl脚本的链接,它给出了下面的错误
[Mon Jan 04 14:21:24 2010] [error] [client ::1] Options ExecCGI is off in this director
对于正在阅读本文的其他人来说,这个问题似乎是由权限引起的,suexec是问题的一部分。禁用suexec后,一切都很好(这取决于我稍后可能会发现的后续问题)。 我在dir1中有两个文件,/cgi-bin/dashboard-login/,它们使用CGI::Session来管理会话。 这两个文件都设置了一个新会话,如下所示: my $session = new CGI::Session(undef, $cgi, {Directory=>"$sessions_dir_location"}) or die CGI::Session->errstr; 这意味着第二个文件实际
我正在尝试从perl脚本访问现有的php会话。我可以看到从php到perl的示例,但不能看到从perl到php的示例。我最大的问题是如何正确访问/tmp目录。我有所有适当的权限,我只是找不到如何捕获会话。我看到了所有的/tmp/sess~文件,但我找不到任何接近工作示例的内容来说明如何访问它。
#!/usr/bin/perl
# Script to launch the vncserver service and capture output
# Runs, displays $pid to STDOUT, but opened
# files are empty.
use strict;
我正在尝试显示来自infoblox设备的一些信息。当我使用html post在浏览器中运行此代码时,显示MAC地址条目的表不显示来自api的值。当我在unix命令行中运行这段代码时,变量会相应地显示出来。有什么建议吗?
#!/usr/bin/perl
use strict;
use Infoblox;
use CGI;
my $cgi = new CGI;
print
$cgi->header() .
$cgi->start_html( -title => 'Form Results') .
$cgi->h1('Form Results
我在使用CGI::Session在MySQL数据库中存储会话时遇到了一个问题。
这是一段代码片段
#!/usr/bin/perl
use CGI;
use CGI::Session;
use CGI::Session::Driver::mysql;
use DBI;
use DBD::mysql;
use Net::LDAPS;
require '../include/include.pl';
$LDAP_SERVER = 'my.test.ldap.example.com';
$LDAP_SSL_PORT = '636';
$LDAP_B
当我试图运行我的Perl CGI程序时,返回的网页告诉我:
软件错误:有关帮助,请发送邮件给网站管理员(root@localhost),给出此错误消息和错误的时间和日期。
下面是我在其中一个文件中的代码:
#!/usr/bin/perl
use lib "/home/ecoopr/ecoopr.com/CPAN";
use CGI;
use CGI::FormBuilder;
use CGI::Session;
use CGI::Carp (fatalsToBrowser);
use CGI::Session;
use HTML::Template;
use MIME::B
遵循上的CentOS 5.2,只需要第一次设置CentOS。主页面显示得很好,但是当我试图查看任何应该由cgi进程生成的页面时,firefox会提示我保存.cgi,因此apache显然不理解它需要运行cgi并从中获取一些html。
但奇怪的是,据我所知,apache应该以cgi的形式运行这些文件。nagios.conf:
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be in
使用和页面中的示例,我尝试实现_login函数,但没有成功。我正在使用Windows7和Apache2。
#!/usr/bin/perl -w
use strict;
use CGI::Carp qw(fatalsToBrowser);
use CGI;
use CGI::Session;
use CGI::Session::Auth::DBI;
my $cgi = new CGI;
# using '.' directory for testing
my $session = new CGI::Session(undef, $cgi, {Directory=>&
我的主机给我发邮件说
I have set the session.save_path = /home/users/web/b1475/moo.youraccount/cgi-bin/tmp for your account
然后我发现我的网站给了我这个错误
Warning: session_start() [function.session-start]: open(/home/users/web/b1475/moo.youraccount/cgi-bin/tmp/sess_718a8cd346244df6916f016eb315f19f, O_RDWR) failed: No such f
当我将use CGI::Session;添加到cgi文件中时,会得到以下错误:
写入CGI答复时发生错误
如果我评论这句话的话,它的效果很好。
我正在使用cPanel托管我的网站。造成这个错误的原因是什么?这是不是缺少了托管服务提供商服务器上的CGI::Session模块?
如何解决这个问题?
代码:
#!/usr/local/bin/perl
use HTML::Template;
use DBI;
use CGI;
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
#use CGI::Session ;
#send the o
这是一个相当复杂的问题。考虑下面的小perl代码:
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw{ :standard };
use CGI::Carp qw{ fatalsToBrowser };
my $q = CGI->new;
print "Content-type: text/html\n\n";
print "<head>\n";
print "<script src='/home/bloodcount/Desktop/pm.js' typ
我有一个perl-cgi脚本,我试图通过它登录。
当UserName和密码有效时,我创建一个会话并将cookie重定向到另一个页面。
但是,在会话过期后(我已经设置了过期时间),在本例中,我没有看到它从/tmp/ session文件夹中被删除。我也使用了这个命令来删除会话。
有人能帮我在会话到期后删除它吗?另外,一旦会话被删除,cookie是否过期?
use CGI::Session;
use CGI::Session::Tutorial;
use CGI::Session::Driver::file;
use CGI::Coo
我是一个PHP和windows新手,在查看我用PHP创建的表单时会遇到以下错误。
Error in exception handler: The stream or file "C:\inetpub\wwwroot\wrp\app\storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in C:\inetpub\wwwroot\wrp\vendor\monolog\monolog\src\Monolog\Handler\StreamHandler.php:8
我在同一个cgi文件夹中有两个cgi文件。一个复杂的300百行脚本运行良好,但是对于这个简单的cgi脚本:
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print "<html><head>";
print "<title>CGI Test</title>";
print "</head>";
print "<body><h1>I just wrote a web page