/contrib/famzah

Enthusiasm never stops

Print to STDERR in PHP

1 Comment

If you are writing a command line tool in PHP and want to write to STDERR, here is the command:

file_put_contents('php://stderr', 'This text goes to STDERR');

The relevant documentation page is PHP input/output streams.

P.S. I actually wanted to reply to this page, but there was no way to leave a comment there…

Advertisements

Author: Ivan Zahariev

An experienced Linux & IT enthusiast, Engineer by heart, Systems architect & developer.

One thought on “Print to STDERR in PHP

  1. Hi, that’s my page that allows no comments. I used to have commenting through haloscan, but they shut down (or at least shut down their free service). Setting up Disqus has been on my to-do list for a long time.

    Thanks for the tip on file_put_contents()! I’ll update my page.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s