jkpolsar Posted December 23, 2007 Share Posted December 23, 2007 Hi, I have a problem using shell_exec and I think I've narrowed it down to PHP trying to execute the command as user "apache" instead of "root" or the user who created the file I'm trying to edit "videogam" How do I change the user executing the unix command through shell_exec to "videogam" instead of "apache"? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/82868-shell_exec-need-to-change-logged-in-user/ Share on other sites More sharing options...
mr_mind Posted December 23, 2007 Share Posted December 23, 2007 Under linux: <?php $switch_user_command = 'su ' . $user_name; shell_exec($switch_user_command); ?> I am not a windows user so if you are using windows i cannot help you Quote Link to comment https://forums.phpfreaks.com/topic/82868-shell_exec-need-to-change-logged-in-user/#findComment-421479 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.