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 #177710 is a reply to message #177708] Mon, 16 April 2012 08:07 Go to previous messageGo to previous message
Une Bvue is currently offline  Une Bvue
Messages: 30
Registered: March 2012
Karma:
Member
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" ?
[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: Thu Nov 07 13:37:11 GMT 2024

Total time taken to generate the page: 0.03727 seconds