fire gun

导航

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 2023-06-11 20:17  Barret_gun  阅读(78)  评论(0)    收藏  举报