I am using PHP to ssh into a main computer and run a command. My code is posted below but I'm stuck having the following issue:
When I run this command from the Ubuntu command line it works flawlessly. However when I try and run it via the web page I believe the ssh commands are not running. Not sure if I am running into issues with permissions, or if I am running into issues with my actually ssh command in php. Any help would be appreciated.
$cmd = "ssh name@ip 'echo hello'";
$var = shell_exec($cmd);
echo $var;