下载python2.7   下载apache2.4

打开apache httpd.conf

1.打开LoadModule proxy_http_module modules/mod_proxy_http.so扩展

2.ScriptAlias /cgi-bin/ "D:/apache24/cgi-bin/" 配置cgi文件夹

3添加(.py扩展).AddHandler cgi-script .cgi .py

4.

python2.7 + apache2.4 环境搭建

在配置的cgi-bin文件夹中添加hello.py文件

内容如下:

#!D:/Python2.7/python.exe         python解释器安装路径必填
print "Content-type: text/html"
print 
print "hello world"

重启apache完成,打开localhost:端口/cgi-bin/hello.py测试,如果出现hello world恭喜你配置成功

 

相关文章:

  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-10-24
  • 2021-09-10
  • 2022-12-23
猜你喜欢
  • 2021-10-29
  • 2021-05-23
  • 2021-05-23
  • 2021-09-12
  • 2021-04-24
相关资源
相似解决方案