- 论坛徽章:
- 0
|
搭建服务器:ubuntu10.04、 apache 2.2.24、perl 5.10.1
httpd.conf配置内容:- Alias /search/ /var/www/tangbuild/
- <Directory "/var/www/tangbuild/">
- DirectoryIndex index.html
- Allow from all
- AllowOverride None
- </Directory>
- ScriptAlias /search/ /var/www/tangbuild/cgi-bin/
- <Directory "/var/www/tangbuild/cgi-bin/">
- DirectoryIndex index.cgi,.pl
- SetHandle perl-script
- PerHandler ModPerl::Registry
- Options +ExecCGI -MultiViews +SymLinksIfOwerMatch
- Allow from all
- AllowOverride None
- </Directory>
复制代码 本机访问 http://127.0.0.1/tangbuild.cgi-bin/login.cgi 正常,apache error.log报:log4j:ERROR setFile(null,false) call failed
远程访问该页面 http://IP/tangbuild.cgi-bin/login.cgi 则无法正常显示,
报错:
-e: Use of uninitialized value $search in concatenation(.) or string at /var/www/tangbuild/cgi-bing/login.cgi line 20.
对应代码内容:- #!/usr/bin/perl -w
- use strict;
- use CGI qw/:standard :html3/;
- use CGI::Carp 'fatalsToBrowser';
- use CGI::Session;
- use XML::Simple;
- use Encode;
- use utf8;
- use open ":encoding(gbk)",":std";
- my $cgi = new CGI;
- my $y = new XML::Simple;
- my $search_word = $cgi->param('search_word');
- my $xml = `/var/www/supose/supose-0.6.2/bin/supose se -I /var/www/supose/repositroy -Q '$search_word' -x `;
复制代码 “`/var/www/supose/supose-0.6.2/bin/supose se -I /var/www/supose/repositroy -Q '$search_word' -x `”
执行结果是一个xml文件。
有人知道这个报错的原因吗?
|
|