python第一次cli程序的坑

发布时间 2023-06-11 14:33:56作者: Barret_gun

错误一: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")