将html与perl连接时出现apache错误 [英] apache error when interfacing html with perl

查看:63
本文介绍了将html与perl连接时出现apache错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


当我使用html(参见下面的b部分)激活acctman.pl时,我得到了这个apache错误(参见下面的A1和A2节) c以下)。下面的D部分是c部分配置的一部分。


由于网页显示内部服务器错误,不确定哪里出错。


另外,错误543是什么?和错误2114.在哪里可以找到网站中的错误列表,因为它不是标准的apache错误。我在互联网上根本找不到任何未正确设置或未定义的内容?脚本中的cgi-bin direcfory被证明是正确的,并且htdocs目录也设置正确。


下面的2个Perl脚本检查是好的,没有使用例如语法错误:perl -c acctman.pl命令。



非常感谢提前,

Andrew


A1)访问apache的日志

==================

127.0.0.1 - - [17 / Oct / 2008:00:09:41 -0700]" GET /amform.html HTTP / 1.1" 200 2114

127.0.0.1 - - [17 / Oct / 2008:00:20:42 -0700]" POST /cgi-bin/acctman.pl HTTP / 1.1" 500 543


A2)错误登录apache

================

[Fri Oct 17 00:20:43 2008] [错误] [client 127.0.0.1]脚本标题的提前结束:acctman.pl,referer:http://127.0.0.1/amform.html

[Fri Oct 17 00:20:43 2008] [错误] [客户端127.0.0.1]无法找到c:/ program files / apache software foundation / apache2.2 / cgi-bin / config.pl in @INC(@INC包含:C:/ perl / site / lib C:/ perl / lib。)在D:/ Program Files / Apache Software Foundation / Apache2.2 / cgi-bin / acctman.pl第75行。 r,referer:http://127.0.0.1/amform.html



B)html页面

=== =======

Hi All,

I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c.

Not sure where went wrong as the web page displayed internal server error.

Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find at all in internet, anything not set correctly or not defined? The cgi-bin direcfory in the script is proven correct and htdocs directory is also set correctly.

The 2 Perl scripts below checked to be good without syntax error using e.g. : perl -c acctman.pl command.


Great Thanks in advance,
Andrew


A1) Access log in apache
==================
127.0.0.1 - - [17/Oct/2008:00:09:41 -0700] "GET /amform.html HTTP/1.1" 200 2114
127.0.0.1 - - [17/Oct/2008:00:20:42 -0700] "POST /cgi-bin/acctman.pl HTTP/1.1" 500 543

A2) error log in apache
================
[Fri Oct 17 00:20:43 2008] [error] [client 127.0.0.1] Premature end of script headers: acctman.pl, referer: http://127.0.0.1/amform.html
[Fri Oct 17 00:20:43 2008] [error] [client 127.0.0.1] Can''t locate c:/program files/apache software foundation/apache2.2/cgi-bin/config.pl in @INC (@INC contains: C:/perl/site/lib C:/perl/lib .) at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman.pl line 75.\r, referer: http://127.0.0.1/amform.html



B) html page
==========

展开 | 选择 | 换行 | 行号

推荐答案

阅读和理解你得到的日志错误是关键。


此错误:


[2008年10月17日星期五00:20:43] [错误] [客户端127.0.0.1]可以''在D中找到c:/ program files / apache software foundation / apache2.2 / cgi-bin / config.pl在@INC(@INC包含:C:/ perl / site / lib C:/ perl / lib。)中: / Program Files / Apache Software Foundation / Apache2.2 / cgi-bin / acctman.pl第75行。\ r,referer:http://127.0.0.1/amform.html


似乎是由这引起的:


需要c:/ program files / apache software foundation / apache2.2 / cgi-bin / config.pl;


问候,


杰夫
Reading and understanding the log errors that you get is key.

This error:

[Fri Oct 17 00:20:43 2008] [error] [client 127.0.0.1] Can''t locate c:/program files/apache software foundation/apache2.2/cgi-bin/config.pl in @INC (@INC contains: C:/perl/site/lib C:/perl/lib .) at D:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/acctman.pl line 75.\r, referer: http://127.0.0.1/amform.html

seems to be caused by this:

require "c:/program files/apache software foundation/apache2.2/cgi-bin/config.pl";

Regards,

Jeff


你好Jeff,


但是config pl位于此cgi-bin目录中,并且提到的示例脚本文档需要更改它。那么如何配置这个语句呢?或者任何其他选择?


谢谢和最好的Rgds,

Andrew
Hi Jeff,

But the config pl is in this cgi-bin directory and the sample script documentation mentioned need to change it. So how to configure this statement? or any alternative?

Thanks and Best Rgds,
Andrew


嗯,错误是声明它不能在c:/ perl / site / lib或c:/ perl / lib中找到该文件。您必须记住,当您使用要求时或者使用,Perl寻找在@INC中列出的一个目录中查找模块。位于这些目录中的文件用于安装的模块。如果config.pl是一个模块,那么它将被称为config.pm。与其他需要用于读取和导入文件的语言不同,在Perl中,它用于告诉perl使用模块(就像使用命令一样)。


由于config.pl实际上只是一个带有一堆变量的配置文件,你最好的选择可能是将文件重做为一个实际的配置文件,其中有一个如此布局:


名称价值

名称价值

名称价值








然后,您可以读入文件并将其放入带有名称的哈希值中。在每一行是一个关键,价值是......好......价值。这是相当简单和非平凡的,但这是我的建议。


问候,


杰夫
Well, the error is stating that it cannot find that file in either c:/perl/site/lib or c:/perl/lib. You have to remember that when you use "require" or "use", Perl looks to find the modules in one of the directories that are listed in @INC. The files located in those directories are for installed modules. If config.pl were a module, then it would be called config.pm. Unlike other languages where require might be for reading and importing a file, in Perl, it is for telling perl to use a module (as is the use command).

Since config.pl is actually just a configuration file with a bunch of variables, your best bet may be to redo the file to be an actual config file where it has a layout as such:

name value
name value
name value
.
.
.

Then, you could read in the file and put it into a hash with the "name" on each line being a key and the value being....well....the value. Its fairly simple and non-trivial to do that, but that''s my recommendation.

Regards,

Jeff


这篇关于将html与perl连接时出现apache错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆