折腾了两天终于把问题解决了,mac os是10.10.3.。够新了吧

 

系统原生的apache配置cgi老是配不好,突然发现xampp也有macos版的,准备下下来试试。

安装完成后,打开apache服务

新建一个文件test.py

1 #!/usr/bin/python
2 print "Content-type: text/html"
3 print
4 print "<html><head>"
5 print ""
6 print "</head><body>"
7 print "Test Page"
8 print "</body></html>"

存入到程序目录下的cgi-bin文件夹下,访问网址:

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

提示没有权限,打开控制台切换到对应目录

sudo chmod 755 test-cgi

再试试,成功!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2021-11-11
  • 2021-08-11
  • 2021-08-09
  • 2021-12-11
  • 2022-12-23
猜你喜欢
  • 2021-08-09
  • 2021-08-20
  • 2021-12-03
  • 2021-12-06
  • 2021-08-23
  • 2022-12-23
  • 2021-10-11
相关资源
相似解决方案