FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » executing command with shell_exec()
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: executing command with shell_exec() [message #169368 is a reply to message #169365] Wed, 08 September 2010 16:51 Go to previous messageGo to previous message
cerr is currently offline  cerr
Messages: 33
Registered: September 2010
Karma:
Member
On Sep 8, 9:21 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 9/8/2010 12:06 PM, cerr wrote:
>
>> Hi There,
>
>> I execute a script in my php script with shell_exec():
>>         $cmd = SCRIPT_PATH."PingGPSsource.py ".$_SESSION['prgIP']." ".
>> $_SESSION['AVLIP'];
>>         logOutput("cmd:".$cmd);
>>         $avlRet=shell_exec($cmd);
>>         logOutput("result:".$avlRet);
>
>> Now if i execute the $cmd in a normal shell, it works with no problem
>> but when i execute it through my php script, $avlRet stays empty. Why
>> is that and how can I fix this?
>> Thanks for help and suggestions!
>
>> Ron
>
> First thing I would want to know is what is in SCRIPT_PATH?  
Hi Jerry,

cmd looks like:
/var/www/localhost/cgi-bin/PingGPSsource.py 192.168.103.75 169.254.0.1

> When you
> say you execute it from your php script - do you mean running under the
> web server?  If so, does the web server have access to the script and
> permission to execute it?
Yes, it is set to be world executable, I chmod-ed it to 777

> Are you sure the script is actually not executing, or could it be
> executing but not producing any output?
Well it actually seems as if the script would run but as if php
wouldn't let it execute all the way. I put a print in the first line
and that is what i'm getting back but nothing else...
The python script executes a ping on the remote host and thus takes a
second to execute...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Php variables to an email.
Next Topic: Re: Another heredoc question
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 16:36:46 GMT 2024

Total time taken to generate the page: 0.03866 seconds