0

I am trying to run the command:

exec("cat ..........", $output, $var);

Basically, cat "any file" returns no contents in $output, and returns 0 in $var. exec("whoami"); returns "apache" in $output and 0 in $var. Any ideas?

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by lordspace
0

P.S. It used to work just fine and then stopped one day. Not sure at all what was changed, and then ended up doing an OS reload because of other non-related issues.

0

Hi,

$var=0 indicates success in Unix.

you may would like to add "2 > &1", i.e. redirect STDERR to STDOUT.
cat $XXXX 2 > &1

Svet

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.