Reply to Re: exec returns -1

Your name:

Reply:


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>
#######################

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация