CGI程序运行时浏览器里没直接显示,显示下载文件提示界面
时间:2011-06-28
来源:互联网
RT,测试perl写CGI程序环境搭建是否完好,发现浏览器里输入程序名里带上后缀.pl就出现题目里的那个问题。。如果把cgi-bin里的文件名后缀去掉,再在浏览器里输入才可以正常显示,why??
目前httpd.conf的配置
复制代码
perl的版本:v5.8.8
系统平台
p
测试例子: printenv.pl
复制代码
目前httpd.conf的配置
- # Add perlscript extensions like cgi, pl, plx .. etc
- AddHandler cgi-script .cgi .pl
-
- #Add "+ExecCGI" to the options list in root directory
- <Directory />
- Options FollowSymLinks +ExecCGI
- AllowOverride None
- </Directory>
-
-
- <Directory "D:/Apache/cgi-bin">
- AllowOverride None
- Options +ExecCGI
- Order allow,deny
- Allow from all
- </Directory>
-
- #
- # ScriptAlias: This controls which directories contain server scripts.
- # ScriptAliases are essentially the same as Aliases, except that
- # documents in the target directory are treated as applications and
- # run by the server when requested rather than as documents sent to the
- # client. The same rules about trailing "/" apply to ScriptAlias
- # directives as to Alias.
- #
- ScriptAlias /cgi-bin/ "D:/Apache/cgi-bin/"
系统平台

测试例子: printenv.pl
- #!c:/perl/bin/perl.exe
- ##
- ## printenv -- demo CGI program which just prints its environment
- ##
-
- print "Content-type: text/plain; charset=iso-8859-1\n\n";
- foreach $var (sort(keys(%ENV))) {
- $val = $ENV{$var};
- $val =~ s|\n|\\n|g;
- $val =~ s|"|\\"|g;
- print "${var}=\"${val}\"\n";
- }
作者: Cu_fans 发布时间: 2011-06-28
改名.cgi
作者: RE_HASH 发布时间: 2011-06-28
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28