Linux下一般是权限问题,windows这我设置成everyone全开
问题依旧
查看Apache错误日志error.log
[Tue Mar 03 10:06:33.115038 2020] [cgi:error] [pid 2484:tid 1048] (9)Bad file descriptor: [client ::1:55544] AH01222: don't know how to spawn child process: E:/Apache24/cgi-bin/hello.py
网查,说是找不到解释器,检查windows的path,在cmd中运行脚本正常。
检查cgi-bin目录下的python脚本文件,删除#!C:\Users\Administrator\AppData\Local\Programs\Python\Python38\
问题依旧
[Tue Mar 03 10:06:33.036916 2020] [win32:error] [pid 2484:tid 1048] [client ::1:55544] AH02102: E:/Apache24/cgi-bin/hello.py is not executable; ensure interpreted scripts have "#!" or "'!" first line
发现需要加上python.exe 最终效果:
#!C:\Users\Administrator\AppData\Local\Programs\Python\Python38\
问题依旧,但是问题是HTML格式错误,也就是python程序运行了,只是我写的代码有问题。
[Tue Mar 03 10:09:05.824618 2020] [cgi:error] [pid 2484:tid 1048] [client ::1:55622] malformed header from script 'hello.p