Thanks for ur reply. I'm running httpd with php on my linux box. I dont know how to enable the exec in php.ini. Tried safe mode but no use. I get the following output from the command [root@melville html]# php -r 'system("whoami");' Error in argument 1, char 2: option not found r however, with who.php, it works [root@melville html]# php who.php Content-type: text/html X-Powered-By: PHP/4.3.9 root :( I'm still stuck with it. Z. On Fri, 24 Dec 2004 08:13:37 -0600, Greg Donald <destiney@xxxxxxxxx> wrote: > On Fri, 24 Dec 2004 12:09:51 +0000, Zia Syed <zia.chacho@xxxxxxxxx> wrote: > > I've been trying to execute some system commands and print back the > > output on the webpage. I found the following code to do so, however, > > it is not working. > > <?php > > echo exec('whoami'); > > ?> > > > > However, i tried to switch on the Safe_Mode but that wasn't any good either. > > Any idea how can i get it work? > > I assume you're hosting with someone and they have dsiabled that > function via the php.ini, I dunno.. Anyway, you might get lucky and > they are using a different php.ini for the php binary. Try this from > command line: > > php -r 'system( "whoami" );' > > -- > Greg Donald > Zend Certified Engineer > http://gdconsultants.com/ > http://destiney.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php