Configuration python CGI in XAMPP in win-7

时间:2021-09-13 01:32:12

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:

Configuration python CGI in XAMPP in win-7

2.try the new password:

Configuration python CGI in XAMPP in win-7

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