Configuration python CGI in XAMPP in win-7

本文指导您如何在Windows环境下安装XAMPP并添加MySQL路径到系统环境变量,设置根用户密码,并通过在Apache配置文件中添加CGI处理程序来测试CGI脚本。

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

 

 

 

转载于:https://www.cnblogs.com/impact-crusher/p/3325699.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值