General
cancel
Showing results for 
Search instead for 
Did you mean: 

I'm looking for a PHP script to start process on linux server

SOLVED
Go to solution
'chris'
Super Advisor

I'm looking for a PHP script to start process on linux server

hi

I'm looking for a PHP script
using using exec command,
to start process on linux server,
like cisco vpn client:

/etc/init.d/vpnclient_init restart

from client via browser.

best regards
cc
4 REPLIES
Michael Schulte zur Sur
Honored Contributor

Re: I'm looking for a PHP script to start process on linux server

Hi,

I think, you find here what you are looking for:
http://www.php.net/manual/en/ref.exec.php

greetings,

Michael
'chris'
Super Advisor

Re: I'm looking for a PHP script to start process on linux server

yes, and now it works !

thanks
chris
'chris'
Super Advisor

Re: I'm looking for a PHP script to start process on linux server

sorry big mistake !

it works only if I start the script from shell but still doesn't work via browser

any idea ?

regards
chris
Stuart Browne
Honored Contributor
Solution

Re: I'm looking for a PHP script to start process on linux server

Well, it's probably a user issue.

When your Web server tries to start the daemon, it will launch as the apache/www user, not as a 'root' or the normal user.

You either need to suid wrap the start routine (using a perl suid script), or get the vpnclient_init to work as a user (I don't think that can be done, but I've not tried).

To proove this, log in to your machine, 'su' to your web-server user (www or apache usually), then try '/etc/init.d/vpnclient_init', and see what errors you get.
One long-haired git at your service...