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.
Restarting a Server from a Web Application
You can execute any shell-command from PHP, both on Windows and Linux. You can use system() to do this.
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.
| 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.
