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 .cgiPYTHON 示例:
--------------------------------------------
#!/usr/local/bin/python
print "Content-type: text/html\n\n"
print "CGI support testpython CGI 测试
"RUBY 示例:
--------------------------------------------
#!/usr/local/bin/ruby
print "Content-type: text/html\n\n"
print "CGI support testruby CGI 测试
"
PERL 示例:
--------------------------------------------
#!/usr/local/bin/perl
print "Content-type: text/html\n\n" ;
print "CGI support testperl CGI 测试
" ;使用浏览器打开 , 能出现CGI输出文字即正常
阅读(1723) | 评论(0) | 转发(0) |