Re: constants STDOUT, STDERR, STDIN not working in 5.2.x?

From: Date: Wed, 24 Mar 2010 13:12:02 +0000
Subject: Re: constants STDOUT, STDERR, STDIN not working in 5.2.x?
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-303283@lists.php.net to get a copy of this message
Hello,
daniel@daniel-laptop:~$ php test.php> /dev/null Error 1 Error 2 daniel@daniel-laptop:~$ ./src/php-5.2.12/sapi/cli/php test.php> /dev/null Error 1 Error 2
well, using php-cli instead of php-cgi, this finally worked: <? fwrite(STDERR, "test\n"); fclose(STDERR); ?> But why doesn't it work with php-cgi? That's a binary that is called with the php-file is parameter the same way as php-cli. So both come with STDIN/STDOUT/STDERR contrary to scripts running through mod_php. What is the real difference between php-cli and php-cgi? This "fclose(STDERR);" is really important for one customer, because this is seems to be the only way to suppress later output to STDERR in the same script by external commands and functions that are too hard to change. But I don't want to break things for all other customers just to make one happier. Can the STDERR constands be enable somehow at compile-time for php-cgi? Regards Marten

« previous php.general (#303283) next »