xampp2016-apache2.4.18-配置python cgi-bin

匿名 (未验证) 提交于 2019-12-02 22:51:30

为了配置python cgi-bin,遇到了好多坑,403,404,500等报错。

先将配置过程记录如下:

环境:

1.xampp 2016

2.apache2.4.18

过程:

1.在xampp目录下新建cgi-bin文件夹(如果没有cgi-bin文件夹)。

2.新建测试用的python脚本,如hello.py, 代码如下:

 1 #!G:/python3.6/python.exe  2 # -*- coding: utf-8 -*-  3 print("Content-type:text/html")  4 print()              # 空行,告诉服务器结束头部  5 print('<html>')  6 print('<head>')  7 print('<meta charset="utf-8">')  8 print('<title>HelloCGI Program!</title>')  9 print('</head>') 10 print('<body>') 11 print('<h2>Hello Word! CGI PROGRAM</h2>') 12 print('</body>') 13 print('</html>')

3.修改 xampp\apache\conf\httpd.conf 文件


https://www.cnblogs.com/feifeidxl/p/5556696.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!