You are here: "Premature end of script headers: php.cgi" « PHP Language « IT news, forums, messages
"Premature end of script headers: php.cgi"

Posted by Christoph Burschka on 08/01/07 05:39

I have compiled PHP 5.2.3 as a CGI binary, and this works. I can, for example,
do the following:

$ php.cgi hello_world.php
X-Powered-By: PHP/5.2.3
Content-type: text/html

Hello World!

===

However, this completely fails when I attempt to route PHP scripts through this
new CGI executable with .htaccess. My approach is this:

File: doc_root/.htaccess
AddHandler phpFive .php
Action phpFive /php.cgi

(doc_root/php.cgi links to the correct executable)

Any PHP page I visit in my browser now returns a 500 error, and the error log
contains this:

Premature end of script headers: php.cgi

It's clearly not the fault of the PHP executable itself, since it works from the
command line.

===

I have also tried renaming the link so it no longer has a .cgi extension.
Instead, I now get the following errors on all PHP pages.

Warning: Unexpected character in input: ' in php-cgi on line 571
Warning: Unexpected character in input: ' in php-cgi on line 571
Parse error: syntax error, unexpected ',' in php-cgi on line 571

At a wild guess, I'd say that the problem is that the server tries to interpret
the PHP executable rather than execute it as a native binary. Any ideas how I
can stop that?

--
cb

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация