On Wed, Mar 24, 2010 at 14:12, Marten Lehmann <lehm...@cnm.de> wrote:
> Hello,
>
>> dan...@daniel-laptop:~$ php test.php>  /dev/null
>> Error 1
>> Error 2
>> dan...@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

Reply via email to