Re: Funny php://stdout behaviour
| From: | ARTEK | Date: | Wed, 24 Jan 2001 09:15:48 +0000 |
| Subject: | Re: Funny php://stdout behaviour | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-36380@lists.php.net to get a copy of this message | ||
Hi Richard, thank you for your answer:
>> When calling the php4 code below, sometimes the browser receives
>> -the "HTML estandar text"
>> -sometimes the "Text generated from PHP" (but NEVER both!)
>> -and ocassionaly the error:
>> "Warning: fopen("php://stdout","w") - Bad file descriptor in
>> /home/sites/site74/web/_proc/pruebas/stdout-test.php on line 7
>> unable to open device"
>
>I actually was getting prompted to download the .php file sometimes...
>
>That was a known bug with an earlier release of PHP4 under high load, I
>think... Or maybe that was the one where turning the engine on/off in
>different domains was messing up?... Or maybe both conditions had to be
>true.
>
>Meanwhile, not sure how fopen() is involved.
>
>Maybe try whatever corresponds to stdout on your OS, be it "/dev/0" or
>"/dev/stdout" or whatever -- Just to see if you can duplicate it with the
>normal file-system stuff.
I tried "/dev/stdout" as the manual states, but I get an error in PHP4 (I think
it works for PHP3). Even in Windows similar behaviour occurs.
>
>And try the same thing with some other files/pages etc.
>
The same occurs with other files.
>One thing that occurs to me -- stdout starts off by being the browser, so
>it's kinda funky to open it -- You've already got it open... I *think* it
>really only makes sense to fopen() stdout from the command line. At least,
>I'm not clear on what it would mean to open it from a HTTP environment...
You may be right, it's quite weird. The use it was intended for was to generate
an HTML page on the fly or a static one, according to certain conditions.
>
>--
>Visit the Zend Store at http://www.zend.com/store/
>Wanna help me out? Like Music? Buy a CD:
>http://l-i-e.com/artists.htm
>Volunteer a little time: http://chatmusic.com/volunteer.htm
--
Saludos, Rubén Blanco.
______________________________________________________
A r t e k - 928.52.20.77 - http://www.artek.es