LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Running shell commands thru PHP (http://www.linuxquestions.org/questions/linux-software-2/running-shell-commands-thru-php-395850/)

JonathonReinhart 12-23-2005 01:44 AM

Running shell commands thru PHP
 
Hello everyone - I'm sure this has got to be possible, but everything i've tried fails to do what I'd like. I would like to have an admin console on my webserver (publicly-acessible) where I can login (with basic or MD5 authentication), and have a page with three options:

Reboot Server
Halt Server
Restart HoTTProxy

So I'd pretty much like to be able to run the commands, from the internet: 'reboot' 'halt' and '/etc/init.d/HoTTProxy restart'

How exactly do you go about doing this in php, and how can I verify that they are working (ie from the web page?)

thanks!
Jonathon Reinhart

timmeke 12-23-2005 02:05 AM

Have you looked at the system() function in PhP?
It's described on php.net.


All times are GMT -5. The time now is 11:31 PM.