Monthly Archive for November, 2008

[Hint] Reading STDERR output in PHP

Recently I was working on a command line PHP script. I know that there are better ways to do things, but I didn’t want to use any other language, since most developers in our company know mainly PHP.

The script exec’s MySQL command to execute a batch of SQL queries. I also wanted the script to mail the error messages. mysql redirects error messages to STDERR - but STDERR is by default not available in exec’s output argument.

Walkaround is simple:

exec('your_command 2>&1');

Works!

[Beta] Webbynode - VPS provider

Back to my tech-blogging, hopefully for good!

This is just a quick note to let you know that there’s new VPS hosting service launching and it requires your input. Webbynode is giving out free beta accounts for Ruby on Rails, Django and PHP (and more!) applications.

I have a couple of drafts one-step-from-being-posted and back from project management to development so expect more updates soon.