python写的cgi,end of srcipt output before headers

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
shuyuan
帖子: 23
注册时间: 2014-08-16 17:24

python写的cgi,end of srcipt output before headers

#1

帖子 shuyuan » 2014-08-21 21:34

ubuntu14.04 python写的cgi,文件开头已经包含#!/usr/bin/python3
出现错误如下:
cgid:error end of srcipt output before headers
1.GIF
头像
oneleaf
论坛管理员
帖子: 10455
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

Re: python写的cgi,end of srcipt output before headers

#2

帖子 oneleaf » 2014-08-21 22:30

直接跑一下,看看什么异常
shuyuan
帖子: 23
注册时间: 2014-08-16 17:24

Re: python写的cgi,end of srcipt output before headers

#3

帖子 shuyuan » 2014-08-21 23:33

这个前台的html/js/css,后台是py,中间是这个cgi。所以单独执行会提示其他问题。但是搞不定出这个错误到底是什么意思,还请高人指点啊
头像
astolia
论坛版主
帖子: 6703
注册时间: 2008-09-18 13:11

Re: python写的cgi,end of srcipt output before headers

#4

帖子 astolia » 2014-08-21 23:58

你把错误信息拿到google里搜一下不就知道了?
要输出HTTP协议头,至少都要像 https://docs.python.org/2/library/cgi.html#introduction 里输出Content-Type部分
回复