So habe es hinbekommen:)
Code
$connection = ssh2_connect('localhost', 22);
ssh2_auth_password($connection, 'root', $pw_ssh);
$stream = ssh2_exec($connection, 'screen -S minecraft -p 0 -X stuff "say Der Server geht offline$(printf \\\r)"');
$stream = ssh2_exec($connection, 'screen -S minecraft -p 0 -X stuff "stop$(printf \\\r)"');
ssh2_exec($connection,"exit");