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 #169367 is a reply to message #169366] Wed, 08 September 2010 16:41 Go to previous messageGo to previous message
cerr is currently offline  cerr
Messages: 33
Registered: September 2010
Karma:
Member
On Sep 8, 9:38 am, jodleren <sonn...@hot.ee> wrote:
> On Sep 8, 7:21 pm, 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?  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.
>> jstuck...@attglobal.net
>> ==================
>
> It works, we just now realised the problems with filename with 2 dots.
>
> Btw the problem is the same with file:// - so the problem is probably
> on the client side, I wonder if there is anything to do about it...
>
> Sonnich

Ho Sonnich,

I'm not exactly sure what you mean by "the problems with filename with
2 dots"...my path isn't file:// but "/var/www/localhost/cgi-bin/
PingGPSsource.py 192.168.103.75 169.254.0.1"

Thanks for your help!
Ron
[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:28:55 GMT 2024

Total time taken to generate the page: 0.05019 seconds