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

Home » Imported messages » comp.lang.php » problems with exec()
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: problems with exec() [message #177717 is a reply to message #177710] Mon, 16 April 2012 17:29 Go to previous messageGo to previous message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma:
Senior Member
Une Bévue wrote:
> Le 16/04/2012 07:17, J.O. Aho a écrit :
>>>
>>> php> $a = exec('/sbin/ifconfig');
>>> php> echo $a;
>>> php> var_dump($a);
>>> string(0) ""
>>
>> Think the ifconfig makes a bit environment check and wants a shell, use
>> shell_exec instead and you will see the output.
>>
>
> On Ubuntu 11.10, this works very well :
> $lines=explode("\n", shell_exec('/sbin/ifconfig'));
> foreach ($lines as $line) {
> echo "$line<br />";
> }
>
> may be the prob i had creating an ssh tunnel comes also from the difference
> between "exec" and "shell_exec" ?

I suspect it could have the same issue, try to use shell_exec and let us know
if it works.

--

//Aho
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: $this->delimiter in php explode
Next Topic: We Need Speakers For MOSC2012
Goto Forum:
  

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

Current Time: Sun Nov 24 20:36:10 GMT 2024

Total time taken to generate the page: 0.05059 seconds