Re: cannot read output with fgets() from popen()
| From: | Jim Barcelona | Date: | Tue, 20 Nov 2001 19:02:42 +0000 |
| Subject: | Re: cannot read output with fgets() from popen() | ||
| References: | 1 | Groups: | php.install |
| Request: | Send a blank email to php-install+get-5043@lists.php.net to get a copy of this message | ||
Try:
<?php
$fp = popen(("/bin/ls"),"r");
while (!feof ($fp))
{
$retvalue = fgets($fp, 4096);
print $retvalue;
}
pclose($fp);
?>
Instead.
simeon@nbermuda.ch wrote:
> i try to:
>
> $fp = popen("/bin/ls"),"r");
> $retvalue = fgets($fp, 4096);
> pclose($fp);
> print $retvalue;
>
> why $retvalue is always "" (blank)? config is: apache, php, suse... all
> newer versions... and standard configurations... apache runs on a specified
> user. does apache needs root rights or suid on shell? target command?
>
> pleas help, tia.
> simeon.
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-install-unsubscribe@lists.php.net
> For additional commands, e-mail: php-install-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
Jim Barcelona mailto:jim.barcelona@maguma.com
+39 3484 22 56 77 -- better living through php