How to re-start a program from web interface using PHP

This is a discussion on How to re-start a program from web interface using PHP within the PHP Language forums, part of the PHP Programming Forums category; Hi, We are running a application on the Linux, and would like to have a web interface to restart it ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-26-2004
KeOu
 
Posts: n/a
Default How to re-start a program from web interface using PHP

Hi,

We are running a application on the Linux, and would like to have a web
interface to restart it remotely using PHP. I would like to get an
advice on how to do it.

Thanks.
KeOu
Reply With Quote
  #2 (permalink)  
Old 06-26-2004
Gary L. Burnore
 
Posts: n/a
Default Re: How to re-start a program from web interface using PHP

On 26 Jun 2004 03:53:06 -0700, kchao@cox.net (KeOu) wrote:

>Hi,
>
>We are running a application on the Linux, and would like to have a web
>interface to restart it remotely using PHP. I would like to get an
>advice on how to do it.


Does the program need to run started as root? The ID you're using to
run PHP? Important questions.

If the program can be started by the same user running php (NOT ROOT),
use the system("/path/to/command); syntax. Otherise:

Create a cron job that runs regularly (like every 5 minutes). Have it
check for the existance of a file where the php ID can write and the
cron job can read and write. Have your php create a file (it can be
empty) and have the cron job watch for its existance.

If the file exists, the cron job restarts the program and removes the
file. If the file doesn't exist, the cron job does nothing.


--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://www.databasix.com
================================================== =========================
Reply With Quote
  #3 (permalink)  
Old 06-26-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: How to re-start a program from web interface using PHP

KeOu wrote:
> We are running a application on the Linux, and would like to have a
> web interface to restart it remotely using PHP. I would like to get an
> advice on how to do it.
>


exec
system
passthru
etc.

All in the manual.


JW



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:58 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0