tim967 Posted April 6, 2011 Share Posted April 6, 2011 Hi everyone, i'm trying to get it so when i visit my webpage called start.php it executes the command (/bigbrotherbot start) in the terminal which then should start the process on my linux machine. I'm currently using this code <?php shell_exec('sudo /bigbrotherbot start'); ?> This script doesn't appear to do anything though. I'm very new to php and would really appreciate the help. P.S the file bigbrotherbot is the bash script which works if i actually go to the terminal myself and type /bigbrotherbot start yet when i try to make the php do it it doesnt do anything. any ideas? Link to comment https://forums.phpfreaks.com/topic/232857-php-execute-linux-terminal-command-bash-script/ Share on other sites More sharing options...
clanstyles Posted April 6, 2011 Share Posted April 6, 2011 I don't think that's the full path of the bot. Also ./bigbrotherbot Link to comment https://forums.phpfreaks.com/topic/232857-php-execute-linux-terminal-command-bash-script/#findComment-1197896 Share on other sites More sharing options...
kenrbnsn Posted April 6, 2011 Share Posted April 6, 2011 Does the user that the webserver is running under have permission to do a sudo? Ken Link to comment https://forums.phpfreaks.com/topic/232857-php-execute-linux-terminal-command-bash-script/#findComment-1197900 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.