Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.
[Fri Jan 29 20:23:28 2010] [error] [client 23.23.23.23] Premature end of script headers: header.php
[Sat Jan 30 10:22:42 2010] [error] [client 23.23.23.23] (8)Exec format error: exec of '/var/www/cgi-bin/header.php' failed

how to fix this ? basically a .cgi script loads header.php which contains javascripts and some php stuff.....

i notice .cgi script runs fine but none of the javascripts and php things work.

share|improve this question
2  
You've given us so little to go on that most of us will be making a complete shot in the dark answering this. Anything else you feel like you can tell us? Are you wanted someone to explain the error message or fix some script. You may want to try stackoverflow. –  Patrick R Jan 30 '10 at 23:08

3 Answers 3

The best anybody can do without more information, since you've given almost none, is guess. Here's mine:

You've either got a missing semicolon or parenthesis or curly brace somewhere (or some other delimiter or bracketing character) or there are DOS line endings (\r\n) where there should be Unix ones (\n).

share|improve this answer

Long shot, but try adding

AddHandler application/x-httpd-php .php

to your apache configuration file.

share|improve this answer

i've two ideas:

  • perhaps you have a permission problem with your php file. make sure it has the right permissions for owner and group.
  • perhaps you are mixing html header and body elements. be sure you are including the php file at the right position.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.