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 #169369 is a reply to message #169363] Wed, 08 September 2010 17:34 Go to previous messageGo to previous message
matt[1] is currently offline  matt[1]
Messages: 40
Registered: September 2010
Karma:
Member
On Sep 8, 12:06 pm, cerr <ron.egg...@gmail.com> 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

Does the Python script rely on any shell environment variables? Those
will be different between the different executions. This includes
$PATH, so if you're calling out to "ping", you may have to provide a
full path. It's hard to guess without knowing the internals of the py
script, but that would also be inappropriate for this group :)
[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: Wed Nov 27 23:15:14 GMT 2024

Total time taken to generate the page: 0.04867 seconds