php ssh2

hi,
i have php script to connect MK and execute same commands. this script work with 2.x 3.x 4.x but not with 5betaX
script execute command, but then stoping - dont execute(write) echo “ssh2_exec finished\n”;
and echo “end script”;

can anyone help me whe is problem ?

(ssh2-0.11.0.tgz libssh2-1.1.tar.gz)

$methods = array('kex' => 'diffie-hellman-group1-sha1');

$connection = ssh2_connect('1.2.3.3', 22, $methods);
if ($connection) {
    echo "connection OK\n\n";
    if (ssh2_auth_password($connection, 'admin', 'passwd')) {
        echo "auth OK\n";
        $s = ssh2_exec($connection, '/export file=backup');
        sleep(2);
        echo "ssh2_exec finished\n";
        fclose($s);
     }
     else {
        echo "auth FAIL\n";
    }
}
else {
    echo "connection FAIL\n\n";
}

echo "end script\n";

Has the problem solved?

Try this:

    $mt = 2.2.2.2;
    $username = "admin";
    $password = "admin";

    $methods = array('kex' => 'diffie-hellman-group1-sha1');

    $connection = ssh2_connect($mt, 22, $methods);
    ssh2_auth_password($connection, $username, $password);
    $shell = ssh2_shell($connection);

    $cmd="/ip firewall address-list disable [/ip firewall address-list find address="1.1.1.1" list="list"]";

    $stream=ssh2_exec($connection,$cmd);

    stream_set_blocking($stream, true);