fire gun

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

python第一次cli程序的坑

错误一:appache error记录到错误:AH01215: (13)Permission denied: exec of '/var/www/cgi-bin/cli_test.py' failed

1.对应程序加上执行权限

2.selinux = disable

3.指定安全上下文 chcon -R -t httpd_sys_content_t /var/www/cgi-bin

这三个方法可以试一下

错误二:malformed header from script 'cli_test.py': Bad header: <html>

在输出的头后面加上 \n\n   print("Content-type:text/html\n\n")

错误三:AH01215: (2)No such file or directory: exec of '/var/www/cgi-bin/cgit_get.py' failed

从win编辑的文件要注意换行符类型,可以vim   set ff=unix 设置为unix的换行解决

 

posted on   Barret_gun  阅读(69)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· 因为Apifox不支持离线,我果断选择了Apipost!
点击右上角即可分享
微信分享提示