title: Premature end of script headers Error in python cgi script
body: <p>I am running to a problem a vps I recently moved to. I am trying to run a python cgi script, but I am getting an apache Premature end of script headers Error.</p>
  
  <p>(I chmod +x the script file)</p>
  
  <p>The script is pretty simple:</p>
  
  <pre><code>#!/usr/bin/env python                                      
  import cgi, cgitb
  cgitb.enable()
  
  print "Content-type: text/html"
  print "&lt;html&gt;&lt;body&gt;hello scritp&lt;/body&gt;&lt;/html&gt;"
  </code></pre>
  
  <p>Now if I name the script as test**.py** it runs fine on server. But if I do it the correct way, calling it test**.cgi** I receive a Internal Server Error.</p>
  
  <p>I run the script from the terminal</p>
  
  <pre><code>./test.cgi
  </code></pre>
  
  <p>I get no errors</p>
  
  <pre><code> Content-type: text/html
   &lt;html&gt;&lt;body&gt;hello scritp&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Did anyone encountered before this issue? And a solution for it? :)
  Cheers</p>