Re: Help on running external command / Partially solved
| From: | Daniel Brown | Date: | Wed, 20 Feb 2008 15:15:53 +0000 |
| Subject: | Re: Help on running external command / Partially solved | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269721@lists.php.net to get a copy of this message | ||
On Feb 20, 2008 9:59 AM, Mário Gamito <gamito@gmail.com> wrote:
> Of course the code is:
>
> $username = 'lixo';
>
> exec("su -c - vpopmail \"/var/qmail/bin/maildirmake
> /home/vpopmail/domains/wwlib.lan/\"$username");
Oh, yes, of course it is!
That still doesn't mean that Apache has the right privileges.
Change the above to this:
<?
$username = "lixo";
exec('su -c - vpopmail "/var/qmail/bin/maildirmake
/home/vpopmail/domains/wwlib.lan/'.$username.'"',$ret,$err);
echo "<pre />\n";
print_r($ret);
echo "</pre>\n";
echo isset($err) ? "Error: ".$err : null;
?>
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>