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 #169365 is a reply to message #169363] Wed, 08 September 2010 16:21 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
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? 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? The web server will almost always have
different permissions than the CLI user.

Are you sure the script is actually not executing, or could it be
executing but not producing any output?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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: Sun Nov 24 03:36:35 GMT 2024

Total time taken to generate the page: 0.04993 seconds