homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

howto start proces via browser with php script using sudo

 10:34 am on Jan 12, 2004 (gmt 0)


I wrote PHP script, to start vpnclient:


$result = exec("ping -c 4 X.X.X.X");

if ("$result?"!= "0") {

exec("/etc/init.d/vpnclient_init restart");



from shell as root user this script is working well.

my problem is:
howto start vpnclient via browser with this script using sudo?

kind regards



 10:11 pm on Jan 12, 2004 (gmt 0)

Welcome to WebmasterWorld, cccc!

I don't use sudo [courtesan.com] myself, but it seems as though you need to have your sudoers [courtesan.com] file setup correctly first. But before going there, is this a Cisco VPN client you are starting? Why not have the client start whenever the server is started/rebooted?

Hopefully this bump will get some discussion started.


 5:13 pm on Jan 31, 2004 (gmt 0)



exec("sudo -u root /etc/init.d/vpnclient_init restart");

is working well!


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved