Lumio Posted October 15, 2007 Share Posted October 15, 2007 Hi! Is there a way to execute commands as root using sudo? If yes, how to use it, if no, how can I get around. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/73313-execute-as-root/ Share on other sites More sharing options...
cooldude832 Posted October 15, 2007 Share Posted October 15, 2007 http://us.php.net/manual/en/function.shell-exec.php Don't know exactly what you are going for as your php server is outside your main server most of the time. Quote Link to comment https://forums.phpfreaks.com/topic/73313-execute-as-root/#findComment-369892 Share on other sites More sharing options...
trq Posted October 15, 2007 Share Posted October 15, 2007 its probably (definately) a bad idea, but you could setup permissions for the www (or whatever user apache runs under) user to execute sudo without a pass. You need to edit your /etc/sudoers file. See... man sudoers for more info. Quote Link to comment https://forums.phpfreaks.com/topic/73313-execute-as-root/#findComment-369925 Share on other sites More sharing options...
Lumio Posted October 15, 2007 Author Share Posted October 15, 2007 No! I don't wan't to do that. But what I can do is to create a little programm that just starts a php-script with root-rights and reads the database. Quote Link to comment https://forums.phpfreaks.com/topic/73313-execute-as-root/#findComment-369961 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.