PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.comp.lang.php > "Premature end of script headers: php.cgi"
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
"Premature end of script headers: php.cgi"

Réponse
 
LinkBack Outils de la discussion
Vieux 01/08/2007, 06h39   #1
Christoph Burschka
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut "Premature end of script headers: php.cgi"

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
  Réponse avec citation
Vieux 01/08/2007, 12h58   #2
Christoph Burschka
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: "Premature end of script headers: php.cgi"

Apparently, cgi WILL NOT resolve symbolic links to the binary itself
(though directory links are resolved).

What does this mean?

The symbolic link chain that connects DOC_ROOT/cgi-bin/php.cgi to
/MY_SOFTWARE/php/php-cgi can pass through as many links and directories
as you want, but it may only link to the parent directory that contains
the actual php.cgi file.

It /cannot/ link directly to the executable.

I hope that this s anyone else who may have had this problem.

--
Christoph Burschka
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h56.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08028 seconds with 10 queries