RE: [PHP] exec command
| From: | Mike | Date: | Thu, 07 Apr 2005 00:46:45 +0000 |
| Subject: | RE: [PHP] exec command | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-212473@lists.php.net to get a copy of this message | ||
> when running a simple php script, below, with exec, I recieve:
> sh: /whoami: No such file or directory
>
> <?php
> // outputs the username that owns the running php/httpd
> process // (on a system with the "whoami" executable in the
> path) echo exec('whoami'); ?>
>
You may want to try using the full path to the whoami command.
Try
echo exec('/usr/bin/whoami');
Or wherever it sits on your machine.
If you don't know the user that PHP runs as, how do you know what it's PATH
variable is...
-M