http.conf, running as a module, shared server - Neither of those things matter, you'd just put a .htaccess file in your cgi-bin if you've got one, and a php script renamed .cgi with the shebang as the first line. Put this there as whoami.cgi
#!/usr/bin/php
<?php
system("/usr/bin/whoami");
?>
Use whatever you've use, ftp or shell to make it executable then go to http://yoursite/cgi-bin/whoami.cgi and see if it works.
EDIT: without the space that the forum puts before the first line.