i try to update my minecraft whitelist over php to my linux server. The connection works but i dont know why he didnt send my command to add the user to the whitelist.
Here my code:
$name=$_POST['name'];
$mc=$_POST['mc'];
if($ssh = ssh2_connect('127.0.0.1', 22)) {
if(ssh2_auth_password($ssh, 'root', 'password')) {
$stream = ssh2_exec($ssh, 'screen -R '.$mc.' && '.'whitelist add '.$name.' && whitelist reload');
stream_set_blocking($stream, true);
$data = '';
while($buffer = fread($stream, 4096)) {
$data .= $buffer;
}
fclose($stream);
echo $data;
}
}