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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 24, 2010 at 14:12, Marten Lehmann <lehmann@xxxxxx> wrote:
> 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

You can see how the CLI SAPI differs from the other SAPIs here:
http://php.net/manual/en/features.commandline.differences.php

-- 
Daniel Egeberg

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux