Chinaunix

标题: 执行/var/www/cgi-bin下的perl脚本要什么要求啊 [打印本页]

作者: emlin128    时间: 2006-11-22 20:30
标题: 执行/var/www/cgi-bin下的perl脚本要什么要求啊
在/var/www/cgi-bin/下有一个脚本,是用来监控交换机的netflow信息的,不过,在执行这个脚本出错,出错信息如下
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
apache和perl是系统默认安装(就是在装系统的时候安装的)httpd出错的信息如下:
[Wed Nov 22 20:14:56 2006] [error] [client 202.75.219.20] Premature end of script headers: CUGrapher.pl
[Wed Nov 22 20:15:12 2006] [error] [client 222.71.174.162] Can't locate rrds.pm in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /var/www/cgi-bin/CUGrapher.pl line 13.
[Wed Nov 22 20:15:12 2006] [error] [client 222.71.174.162] BEGIN failed--compilation aborted at /var/www/cgi-bin/CUGrapher.pl line 13.
[Wed Nov 22 20:15:12 2006] [error] [client 222.71.174.162] Premature end of script headers: CUGrapher.pl
[Wed Nov 22 20:15:12 2006] [error] [client 222.71.174.162] File does not exist: /var/www/html/favicon.ico

还有一个信息是
sleep 30...
2006/11/22 20:25:10 working on file /var/netflow/ft-v05.2006-11-22.202001+0800...
2006/11/22 20:25:10 flowscan-1.020 CUFlow: Cflow::find took  0 wallclock secs ( 0.00 usr +  0.00 sys =  0.00 CPU) for 92 flow file bytes, flow hit ratio: 0/0
2006/11/22 20:25:10 flowscan-1.020 CUFlow: report took  0 wallclock secs ( 0.00 usr  0.00 sys +  0.01 cusr  0.00 csys =  0.01 CPU)
sleep 30...
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.
sleep 30...
sleep 30...
作者: emlin128    时间: 2006-11-22 21:14
怎么没人回答啊,斑竹帮帮忙撒!
作者: ulmer    时间: 2006-11-22 22:36
Hi,
原帖由 emlin128 于 2006-11-22 20:30 发表
在/var/www/cgi-bin/下有一个脚本,是用来监控交换机的netflow信息的,不过,在执行这个脚本出错,出错信息如下
[error] [client 202.75.219.20] Premature end of script headers: CUGrapher.pl
[error] [client 222.71.174.162] Can't locate rrds.pm in @INC (@INC contains: /usr/lib/
...


in your perl script "CUGrapher.pl" uses module "rrds.pm" , but not found where it is.

Use of uninitialized value in numeric gt (>) at /usr/lib/perl5/site_perl/5.8.5/HTML/Table.pm line 1684.


Indicate your script contains undefined variable which will be furtherly accessed by Table.pm

TIPS:
test your perlscript firstly on shell command line
install or let your script to know where is rrds.pm

allawy define a varibale, avoiding to process undefined variables.


rest warning or error is harmless.

-- ulmer




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2