代码改变世界

Configuration python CGI in XAMPP in win-7

2013-09-17 10:03  zoo-code  阅读(302)  评论(0编辑  收藏  举报

1.After install XAMPP,we need add the path of the Mysql

just find the path and add it to your sys-path of windows 

try it from the cmd and chang the password for the root user:

2.try the new password:

 

3.find the httpd.conf in the path:

xampp\apache\conf

add the following lines to the file :

 

AddHandler cgi-script .cgi .pl .asp .py

AddType text/html .shtml .py

Options Indexes FollowSymLinks Includes ExecCGI

 

4.try the code in the cgi-bin path:

hello.py:

#!D:\Python27\python.exe

print "Content-Type: text/html\n"
print "<html><title>hello CGI</title><body><h1>Hello Python CGI</h1></body></html>"

5.add then open the url name this:

http://localhost/cgi-bin/hello.py