LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 661|回复: 3

mod_perl不能运行的问题

[复制链接]
发表于 2004-12-23 17:25:51 | 显示全部楼层 |阅读模式
操作系统:Debian Gnu/Linux Sarge kernel-2.6.8-01
perl:This is perl, v5.8.4 built for i386-linux-thread-multi
mod_perl的安装:apt-get install apache-perl
按照http://perl.apache.org的安装 ... 试程序test.pl:

#!/usr/bin/perl
foreach $key (sort keys %ENV){
    print qq|The value of $key is $ENV{"$key"}\n|;
}

shell 里面运行没有问题,可是用http://localehost/perl/test.pl ... 到问题所在。
并且我已经确认mod_perl肯定加载了:

devhost:/var/www/perl# telnet 192.168.0.202 80
Trying 192.168.0.202...
Connected to 192.168.0.202.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Thu, 23 Dec 2004 08:58:20 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_perl/1.29
Last-Modified: Thu, 23 Dec 2004 08:45:03 GMT
ETag: "401e900-9cd-41ca858f"
Accept-Ranges: bytes
Content-Length: 2509
Connection: close
Content-Type: text/html; charset=iso-8859-1

Connection closed by foreign host.

我的配置文件在附件里面。
谢谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2004-12-23 17:36:34 | 显示全部楼层

怎么变乱码了?

重贴一下:
操作系统:Debian Gnu/Linux Sarge kernel-2.6.8-01
perl:This is perl, v5.8.4 built for i386-linux-thread-multi
mod_perl的安装:apt-get install apache-perl
按照http://perl.apache.org的安装 ... 试程序test.pl:

#!/usr/bin/perl
foreach $key (sort keys %ENV){
print qq|The value of $key is $ENV{"$key"}\n|;
}

shell 里面运行没有问题,可是用http://localehost/perl/test.pl ... l肯定加载了:

devhost:/var/www/perl# telnet 192.168.0.202 80
Trying 192.168.0.202...
Connected to 192.168.0.202.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Thu, 23 Dec 2004 08:58:20 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_perl/1.29
Last-Modified: Thu, 23 Dec 2004 08:45:03 GMT
ETag: "401e900-9cd-41ca858f"
Accept-Ranges: bytes
Content-Length: 2509
Connection: close
Content-Type: text/html; charset=iso-8859-1

Connection closed by foreign host.

我的配置文件在附件里面。
谢谢!
 楼主| 发表于 2004-12-23 17:38:10 | 显示全部楼层

晕,还是乱码

我这次可是手工输入的文字啊。
算了,大意就是我的perl程序只能下载,不能执行。
 楼主| 发表于 2004-12-24 00:23:51 | 显示全部楼层

自己回答

犯了个非常愚蠢的错误,perl程序里面没有送出HTTP响应头:
Content-Type: text/html
加上以后一切正常!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表