03.02.2014, 03:49
Yes, I know this isnt pawn related, but it's still scripting related to samp. I'm trying to make a script to start/stop my server via PHP. I'm no PHP expert, so i'm trying to learn through this. And please, do not simply link me to another panel, I wanna do this myself.
The issue is the SSH, it doesn't start the server when the function is called.
Yes, I know start and stop call the same function
The issue is the SSH, it doesn't start the server when the function is called.
PHP код:
<?php
if( isset( $_REQUEST['start'] ))
{
StartServer();
echo "<script type='text/javascript'>alert('Server Started');</script>";
}
function StartServer()
{
$connection = ssh2_connect("178.63.193.38", 22);
ssh2_auth_password($connection, "purerp", "teeheeilikepie");
shell_exec('cd /home/purerp/samp');
shell_exec('./samp03svr');
}
?>
<form>
<input type="submit" name="start" value="Start Server" />
<input type="submit" name="start" value="Stop Server" />
</form>