FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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
Tutorial: PHP Installed Modules Dynamic Reference Tool
Professional JavaScript For Web Developers
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
Poll-Which language is better for web application?
Starting your own web server tutorial
Google Launched New Free Web Application
Python Web Application Framework
Web Layer and Application Layer
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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