PHP programming question

PHP programming question

von Zbigniew Fiedorowicz -
Anzahl Antworten: 1

How can I access error messages from external programs called via system() or from within backticks? I've tried various approaches without success, except for reading from the web server error logs. I don't like the latter approach, since I might concievably pick up an error message from some other web process running concurrently. Also the web server error logs on our system have somewhat unpredictable names, so I might access the wrong one.

Als Antwort auf Zbigniew Fiedorowicz

Re: PHP programming question

von Zbigniew Fiedorowicz -
I found the answer in the Perl FAQ: add the following string into the system command or the backticks: 2>&1. This shell command redirects STDERR to STDOUT.