Chinaunix首页 | 论坛 | 博客
  • 博客访问: 656739
  • 博文数量: 102
  • 博客积分: 2241
  • 博客等级: 大尉
  • 技术积分: 1670
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-08 10:08
文章分类

全部博文(102)

文章存档

2013年(6)

2012年(15)

2011年(81)

分类: 系统运维

2011-08-29 22:54:29


atpages.jp 免费空间支持 PHP, MySQL, CGI(python,perl,ruby)



使用 CGI 脚本注意点:

1.文件内容编码改为 utf-8
2.回车换行为 Unix下的 \n

3.cgi-bin 目录权限为 755
4.脚本文件权限为 755

5.主目录下创建 .htaccess 文件, 内容为
AddType text/html py
AddHandler cgi-script .py
AddType text/html pl
AddHandler cgi-script .pl
AddType text/html rb
AddHandler cgi-script .rb
AddType text/html cgi
AddHandler cgi-script .cgi






PYTHON 示例:
--------------------------------------------
#!/usr/local/bin/python

print "Content-type: text/html\n\n"
print "CGI support test

python CGI 测试

"



RUBY 示例:
--------------------------------------------
#!/usr/local/bin/ruby

print "Content-type: text/html\n\n"
print "CGI support test

ruby CGI 测试

"


PERL 示例:
--------------------------------------------
#!/usr/local/bin/perl

print "Content-type: text/html\n\n" ;
print "CGI support test

perl CGI 测试

" ;




使用浏览器打开 , 能出现CGI输出文字即正常


阅读(1677) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~