- 论坛徽章:
- 0
|
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 "<html><head><title>CGI support test</title></head><body><p>python CGI 测试</p></body></html>"
RUBY 示例: -------------------------------------------- #!/usr/local/bin/ruby
print "Content-type: text/html\n\n" print "<html><head><title>CGI support test</title></head><body><p>ruby CGI 测试</p></body></html>"
PERL 示例: -------------------------------------------- #!/usr/local/bin/perl
print "Content-type: text/html\n\n" ; print "<html><head><title>CGI support test</title></head><body><p>perl CGI 测试</p></body></html>" ;
使用浏览器打开 http://wwwXX.atpages.jp/USERID/cgi-bin/test0.py , 能出现CGI输出文字即正常
|
|