FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Restarting a Server from a Web Application

 


NewGuyinTown
Does anyone know how to implement a php web application that restart a service (my JBOSS server)? If so, how would I do it? Any advices/help appreciated.
MrBlueSky
You can execute any shell-command from PHP, both on Windows and Linux. You can use system() to do this.

Code:

<?php

if (system('some shell command', $status)) {
    // check return code
    if ($status == 0) {
        // oke
    } else {
        // error: do something
    }
} else {
    // error: could not execute command
}

?>


You only have to find out the proper shell command to restart the JBoss server and, if available, what status codes it returns on success and failure.
Related topics

Poll-Which language is better for web application?
Google Launched New Free Web Application
Python Web Application Framework
Professional JavaScript For Web Developers
Starting your own web server tutorial

Tutorial: PHP Installed Modules Dynamic Reference Tool
Programming
Need Your Advice: Final Project Idea
Dreamweaver or Golive?
Should I make a flash site?

Could this be installed ?
Database for Dentists
What's New in Pocket Internet Explorer
Windows XP Tricks & Tips!!!!
Scripting Language
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.