---
title: "Premature end of script headers"
author: "zhanyingle_1981"
date: "2012-11-22T16:55:07Z"
tags: []
categories: ["编程语言"]
slug: "premature-end-of-script-headers"
draft: false
lastmod: "2012-11-22T16:55:07Z"
id: 1733430
url: "https://leonzhan.iteye.com/blog/1733430"
---

[down vote]()

See:

[http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions#Apache\_Process\_Crashes](http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions#Apache_Process_Crashes)

The message 'premature end of script headers' is usually indicative of your code crashing the daemon process. You can verify this by looking for segmentation fault or similar message in main Apache error log file. If you enable 'LogLevel info' in main Apache config and VirtualHost then mod\_wsgi will log more about daemon process restarts.

A quick remedy if running only application in that daemon process group is to add:

```
WSGIApplicationGroup
 
%{
GLOBAL
}

```

This will work around crashes caused by broken third party extension modules for Python which aren't written properly to work in sub interpreters.

Other than that, can be shared library version mismatches as described in the FAQ.