php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44551 php script don't send output/STDOUT to apache
Submitted: 2008-03-27 15:28 UTC Modified: 2008-07-14 21:37 UTC
Votes:6
Avg. Score:4.5 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:4 (66.7%)
Same OS:0 (0.0%)
From: laurent_baillif at hotmail dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.2.5 OS: *
Private report: No CVE-ID:
 [2008-03-27 15:28 UTC] laurent_baillif at hotmail dot com

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-25 11:37 UTC] john dot walsh at mini-net dot co dot uk
Hi,

I had a similar problem - stdout not getting to apache, but worked from the command line.

I tried switching to using echo (with carefully constructed strings), but that still didn't work.

Then, just to be sure, I put an echo "z" at the start (top level) of my script.

The 'z' came through, along will all the rest of my scripts output.

I changed the echo "z" to echo "" - the script continued to work.

So it seamed that stdout needed some kick-into-life usage, before it would work from my functions.

So something to try.

Note: I was outputting binary data, and I think the first character would have been value 0x0A.

Yours,
John.
 [2008-06-25 12:16 UTC] laurent_baillif at hotmail dot com
Hi,

I have found a solution for my issue! Always send your echo with a "\n" at the end of your script. 

We sould put that in the manuel because it is says no where.

Another issue I have experience:
If your script is running on a windows platform, never leave a magic cookies (from linux for instance) and never leave a blank line at the begining of your script. that will de-synchronise all your answer in STDOUT. 
Let me explain:
request one => answer one: error in apache
request two => answer two: request one in apache
request three => answer three: request two in apache
and so on...

So if you are running on windows, always start your script with the php quote:"<?php" and finish it with "?>" whithout any white space in the middle of the code (e.g like: "?>    <?php" )

Regards
 [2008-07-14 21:37 UTC] jani@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 23:01:58 2014 UTC