By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,350 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,350 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Jul 17 '05 #2

P: n/a
On 26 Jun 2004 03:53:06 -0700, kc***@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
================================================== =========================
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.