[SLL] How to write stderr in PHP

Jeremy C. Reed reed at reedmedia.net
Thu Feb 14 14:15:24 PST 2008


> I'm finding my O'Reilly reference AND even Google unhelpful in trying to
> figure out how to write to stderr in PHP.  Anybody here have any hints?

Here is one way:

[root at ops ~]# cat J.php
<?php

fwrite(STDERR, "to stderr\n");
?>
[root at ops ~]# php -q ~/J.php 2>J
[root at ops ~]# cat J
to stderr


More information about the linux-list mailing list