Posted by inetquestion on 04/17/06 05:11
Checked and the 'echo' binary is in /bin/echo. The PATH for a user
ssh'd in and that of a script being executed by the browser both
include "/bin", so there is no issue from that perspective. This can
also be confirmed that it is working from the output below. Since it
sucessfully produces the string "hello world". The echo command is
working, however the result code which exec is setting is always set to
-1 when the script is invoked by the webserver. This is true even if
the command you are trying to run is invalid or does not exist. If I
run the same script with an invalid command from the command line, the
exec function in this scenario gives a status of 127.
This is the output from hitting this script on a webserver with a
browser:
#######################
Output: hello world
command: echo "hello world"
results: Array
status: -1
#######################
This is the output from hitting this script through an ssh session and
running "php go.php"
#######################
Output: hello world<br><br>command: echo "hello world" <br>results:
Array <br> status: 0 <br>
#######################
Navigation:
[Reply to this message]
|