Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: problems with exec() Date: Sun, 15 Apr 2012 19:43:09 +0200 Lines: 30 Message-ID: <9v0fldFforU1@mid.individual.net> References: <9-SdnWmoCP7eZBfSnZ2dnUVZ7q6dnZ2d@giganews.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net ptaFcf8XmuSNaoycPnkebgfuQPq0u6wvVAPfzXxpluOCyfsrUs Cancel-Lock: sha1:MTzkDXZS51Fz2OAHAZeEOt0wTgM= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120321 Firefox/11.0 SeaMonkey/2.8 In-Reply-To: <9-SdnWmoCP7eZBfSnZ2dnUVZ7q6dnZ2d@giganews.com> Xref: csiph.com comp.lang.php:5533 7segment wrote: > Hi. > > I have an interesting problem and I cannot figure out what the problem > might be. > > This does not produce any output: > > $response = exec('ifconfig'); > echo $response; > > Although when I try other commands, I get a response on the screen. So I > don't get what's so special about ifconfig. > > Could anyone help please? ifconfig usually residence in /sbin (some GNU/Linux distribution are in the migration path of moving it to /usr/sbin), this directory is never in a normal users or a daemon users $PATH, so you need to give the whole path to this binary to be able to run it. By default the file is executional by all users, but someone may have changed permissions or setup ACL rules with for example SELinux. -- //Aho