Redirecting STDERR to a file?

From: Date: Sat, 02 Feb 2008 04:58:34 +0000
Subject: Redirecting STDERR to a file?
Groups: php.general 
Request: Send a blank email to php-general+get-268554@lists.php.net to get a copy of this message
Hi, I was trying to write a script in PHP that takes a program name as an argument and invoke it as a daemon. PHP provides fork(pcntl_fork), setsid(posix_setsid) and umask, so it was easy. However, I couldn't find a way to redirect STDERR a file. I like to have the daemon write its log to its own logfile, like apache and mysql do. So is there any way to accomplish that? Any pointers, suggestions would be greatly appreciated. Thanks.

« previous php.general (#268554) next »