note 85111 deleted from function.shell-exec by cmb

From: Date: Sun, 14 Jul 2019 11:32:11 +0000
Subject: note 85111 deleted from function.shell-exec by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211583@lists.php.net to get a copy of this message
Note Submitter: sa577 at gre dot ac dot uk ---- The problem described by 'concept at conceptonline dot hu' was mine too (writing the output on the Apache error log instead of returning it). But I think the cause explanation is misleading: it is not due to running script in a different path. The clue for this behaviour as Apache documentation mention is: "A very wide variety of different messages can appear in the error log. Most look similar to the example above. The error log will also contain debugging output from CGI scripts. Any information written to <i>stderr</i> by a CGI script will be copied directly to the error log." (http://httpd.apache.org/docs/1.3/logs.html#errorlog) So the most probable cause for this problem is a running script which tends to write its output on stderr instead of stdout. You cannot even capture it by piping (e.g. [command]>[output] syntax of unix). The smart trick to get rid of this situation (that can become a serious one as I experienced) is one suggested by Anatol Pomozov in his currently non-accessible weblog (I saw his post on archive.com!): You should add after your command these characters within the qoutation mark: " 2>&1" I guess it forces OS to copy stderr on stdout.

« previous php.notes (#211583) next »