php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7996 CGI
Submitted: 2000-11-27 16:53 UTC Modified: 2000-11-28 05:22 UTC
From: gb at swisszone dot ch Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.3pl1 OS: linux redhat 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gb at swisszone dot ch
New email:
PHP Version: OS:

 

 [2000-11-27 16:53 UTC] gb at swisszone dot ch
Bonjour,

Il  m'arrive une chose absolument incoryable !!!

J'utilise le dernier php et le dernier apache.

Tout fonctionne ? merveille  avec php en module, mais quand je tente de faire fonctionner php en mode cgi plus rien ne va, j'ai inn?vitablement une erreur 500 premature end  of script headers.

Apache est configur? correctement pour autoriser l'ex?cution des cgi ds le r?pertoire (les scripts perl ds le m?me r?p s'ex?cutent)

Le script php est bien en 755 tout comme le script perl

En ligne de commande en tappant ./test.cgi il marche nikel et me renvoie ?a (soit EXACTEMENT la m?me chose que le script en perl):

------------------------------------------------------------------------------

./test.cgi 

location: http://www.yahoo.com



------------------------------------------------------------------------------

En faisant su httpd  les sorties des 2 scripts sont tout ? fait identiques et correctes !



Ci dessous la source de mes  2 scripts celui en perl qui fonctionne  et celui en php qui fonctionne pas (ils renvoient au caract?re pr?s la m?me chose !!!).

------------------------------------------------------------------------------
#!/usr/bin/php -q

<?php

echo "location: http://www.yahoo.com\n\n";

?>

------------------------------------------------------------------------------

#!/usr/bin/perl

print "location: http://www.yahoo.com\n\n";

------------------------------------------------------------------------------



Merci d'avance pour votre aide !!!



Gregor Bruhin

gb@swisszone.ch

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-27 17:01 UTC] derick@php.net
Bonjour,

could you please resend your bug report, but then written in English? Almost none of the developers speak French

Derick
 [2000-11-27 17:47 UTC] gb at swisszone dot ch
Hi,



I use the latest php and apache.

in the shell when I execute my php and my perl script I get (this is
correct!):

----------------------------------------------------------------------------
--

./test.cgi

location: http://www.yahoo.com



----------------------------------------------------------------------------
--



if I try trough the web I get a premature end of script header for the php
script and the perl  script works, and in the shell the output is exactly
the same so why ??? i tried to make su httpd ans both output are the same
and are ok ...



Here is the source of the scripts:

----------------------------------------------------------------------------
--
#!/usr/bin/php -q

<?php

echo "location: http://www.yahoo.com\n\n";

?>

----------------------------------------------------------------------------
--

#!/usr/bin/perl

print "location: http://www.yahoo.com\n\n";

----------------------------------------------------------------------------
--



Thanks for your help !

Gregor Bruhin

gb@swisszone.ch

 [2000-11-27 17:50 UTC] gb at swisszone dot ch
I think I know exactly what I am doing... And I think the problem does not come from my scripts but realy from php...

In the same directory I have 2 scripts one in perl and the other in php
called test1.cgi and test2.cgi and when I execute them in the shell as user
httpd ./test1.cgi and test2.cgi I get a correct output. but when I do the
same but through apache I get a script header error  from one and the other
works ...

So the only thing possible is that the output changes for the php script when execute through apache, why I think there is no reason no ?
 [2000-11-28 05:22 UTC] sniper@php.net
-q    Quiet-mode. Suppress HTTP header output.

--Jani
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun Oct 11 08:00:01 2026 UTC