RE: exec command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux