You are here: RE: [PHP] exec command « PHP « IT news, forums, messages
RE: [PHP] exec command

Posted by Mike on 04/07/05 03:46

> 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация