#32107 [Com]: fclose (STDIN|STDOUT|STDERR) not working

2006-04-27 Thread matxgx at hotmail dot com
 ID:   32107
 Comment by:   matxgx at hotmail dot com
 Reported By:  php at the-eend dot org
 Status:   No Feedback
 Bug Type: CGI related
 Operating System: Redhat ES3
 PHP Version:  4.3.10
 New Comment:

I actually am experiencing the same issue, as witnessed below using PHP
5.1.2

[EMAIL PROTECTED] ~/src/php $ php -v
PHP 5.1.2-gentoo (cli) (built: Apr 27 2006 10:49:04)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
[EMAIL PROTECTED] ~/src/php $ php std3.php 

Warning: fwrite(): 2 is not a valid stream resource in
/home/gillespiem/src/php/std3.php on line 6
Stdout still open


Any advice would be greatly appreciated.


Previous Comments:


[2005-10-10 23:30:23] valerio at wnet dot it

This bug is still present in php 4.3.10.

Any chance to have it fixed in the 4.3 tree?



[2005-08-06 01:00:04] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to Open.



[2005-07-29 15:35:13] [EMAIL PROTECTED]

Please try it with PHP 5



[2005-07-29 13:01:57] Andreas dot Oesterhelt at InTradeSys dot com

Here's the test case requested by [EMAIL PROTECTED]:

?php

fclose(STDOUT);

/* This now fails..*/
fwrite (STDOUT, Test);

/* but this still works: */
echo Stdout still open\n;

/*
 * Standard output is still open.
 * The process is therefore unable to detach from its terminal.
 * See PHP Bug #27865 (PHP5, fixed)
 */

?

Tested in PHP 4.3.10 (cli)



[2005-03-20 18:01:30] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to Open. Thank you.





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/32107

-- 
Edit this bug report at http://bugs.php.net/?id=32107edit=1


#32107 [Com]: fclose (STDIN|STDOUT|STDERR) not working

2005-10-10 Thread valerio at wnet dot it
 ID:   32107
 Comment by:   valerio at wnet dot it
 Reported By:  php at the-eend dot org
 Status:   No Feedback
 Bug Type: CGI related
 Operating System: Redhat ES3
 PHP Version:  4.3.10
 New Comment:

This bug is still present in php 4.3.10.

Any chance to have it fixed in the 4.3 tree?


Previous Comments:


[2005-08-06 01:00:04] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to Open.



[2005-07-29 15:35:13] [EMAIL PROTECTED]

Please try it with PHP 5



[2005-07-29 13:01:57] Andreas dot Oesterhelt at InTradeSys dot com

Here's the test case requested by [EMAIL PROTECTED]:

?php

fclose(STDOUT);

/* This now fails..*/
fwrite (STDOUT, Test);

/* but this still works: */
echo Stdout still open\n;

/*
 * Standard output is still open.
 * The process is therefore unable to detach from its terminal.
 * See PHP Bug #27865 (PHP5, fixed)
 */

?

Tested in PHP 4.3.10 (cli)



[2005-03-20 18:01:30] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to Open. Thank you.





[2005-02-25 14:09:02] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/32107

-- 
Edit this bug report at http://bugs.php.net/?id=32107edit=1


#32107 [Com]: fclose (STDIN|STDOUT|STDERR) not working

2005-07-29 Thread Andreas dot Oesterhelt at InTradeSys dot com
 ID:   32107
 Comment by:   Andreas dot Oesterhelt at InTradeSys dot com
 Reported By:  php at the-eend dot org
 Status:   No Feedback
 Bug Type: CGI related
 Operating System: Redhat ES3
 PHP Version:  4.3.10
 New Comment:

Here's the test case requested by [EMAIL PROTECTED]:

?php

fclose(STDOUT);

/* This now fails..*/
fwrite (STDOUT, Test);

/* but this still works: */
echo Stdout still open\n;

/*
 * Standard output is still open.
 * The process is therefore unable to detach from its terminal.
 * See PHP Bug #27865 (PHP5, fixed)
 */

?

Tested in PHP 4.3.10 (cli)


Previous Comments:


[2005-03-20 18:01:30] [EMAIL PROTECTED]

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to Open. Thank you.





[2005-02-25 14:09:02] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.





[2005-02-25 13:33:10] php at the-eend dot org

True enough, the resource goes from being a stream to an Unknown.
Unfortunately, my terminal still hangs until the script is complete
when I try to log out of the server. If the stream is truly closed (not
saying I don't believe you ;)), I guess it must be something else. :(

I sense an incoming bogus... ;)



[2005-02-25 13:03:46] [EMAIL PROTECTED]

Why do you think they are not closed?
?php
var_dump(STDIN);
fclose (STDIN);
var_dump(fread(STDIN, 10));
?
Or use var_dump() in your example:
?php
var_dump(STDIN);
fclose (STDIN);
var_dump(STDIN);
?



[2005-02-25 12:54:31] php at the-eend dot org

Description:

This is the same bug as reported and fixed for PHP5 last year:
http://bugs.php.net/bug.php?id=27865 , but is still present in 4.3.10.
Upgrading to PHP 5 is not an option at this point. Any chance this can
be back-ported?


With CLI scripts, fclosing STDIN, STDOUT and STDERR have no effect,
leaving the sockets open, and the terminal which ran the script
hanging.

Reproduce code:
---
echo STDIN . '|' . STDOUT . '|' . STDERR . \n;
fclose (STDIN);
fclose (STDOUT);
fclose (STDERR);
echo STDIN . '|' . STDOUT . '|' . STDERR . \n;


Expected result:

The STDIN, STDOUT and STDERR streams should be closed:

Resource id #1|Resource id #2|Resource id #3
||

(perhaps, though this would mean the value of a 'constant' was being
changed...)

Actual result:
--
The streams are not closed, and remain pointing to the same resources:

Resource id #1|Resource id #2|Resource id #3
Resource id #1|Resource id #2|Resource id #3





-- 
Edit this bug report at http://bugs.php.net/?id=32107edit=1