By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,650 Members | 1,823 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,650 IT Pros & Developers. It's quick & easy.

stderr from "system" should be logged?

P: n/a
Hello. Maybe I'm just out of practice, maybe not.

Suppose we run a command using system() and this command writes to the
stderr stream. If I remember correctly, this is normally written to
the Apache error log file. log_errors is ON and error_reporting is
2047 E_ALL.

Redirecting the stderr from the system command has it showing up on
the browser output.

This is on BSD Unix, Apache 1.3.x , PHP 4.3.3

Any advice what's wrong here is appreciated.

Thanks.

--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile http://www.JerrySievers.com/
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 13 Jan 2005 10:15:15 -0500, Jerry Sievers <je***@jerrysievers.com> wrote:
Suppose we run a command using system() and this command writes to the
stderr stream. If I remember correctly, this is normally written to
the Apache error log file. log_errors is ON and error_reporting is
2047 E_ALL.

Redirecting the stderr from the system command has it showing up on
the browser output.
Redirecting it to what, stdout? Wouldn't that be expected behaviour?
This is on BSD Unix, Apache 1.3.x , PHP 4.3.3

Any advice what's wrong here is appreciated.


Could you give an example line of code to show what you're redirecting to
where?

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2

P: n/a
Andy Hassall <an**@andyh.co.uk> writes:
On 13 Jan 2005 10:15:15 -0500, Jerry Sievers <je***@jerrysievers.com> wrote:

Redirecting it to what, stdout? Wouldn't that be expected behaviour?
Could you give an example line of code to show what you're redirecting to
where?


The test cases;

system('echo foo >&2');

Ok. What's the cause of this problem I found is that the error stream
of system commands does indeed get logged. However, the data is going
to the system wide error_log and not the virtual host specific log
where most of the PHP errors for this VH instance are written.

Interesting. Case closed... as long as the errors are being logged
somewhere, this is good enough for now.

Anyone that knows how I would get these errors into a VH specific
error_log file, please chime in here.

Thanks.

--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile http://www.JerrySievers.com/
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.