私はフロントエンドにボタンを持っていますが、このボタンはバックエンドに話します。 バックエンドは、リモートスクリプト始めている:私は2つの問題、最初のものを持っているPHP:SSH接続とPythonスクリプトの実行
<?php
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
$connection = ssh2_connect('192.168.56.180', 22);
ssh2_auth_password($connection, 'root', 'password');
$stream = ssh2_exec($connection, 'python /WATSON/APP/test/testlistrbk.py');
stream_set_blocking($stream, true);
$stream_out = ssh2_fetch_stream($stream, SSH2_STREAM_STDIO);
echo $stream_out_contente;
fwrite($myfile, $stream_out);
fclose($myfile);
?>
を、それがhere言ったようにPHPが終了するPythonスクリプトを待たなければならないが、それはしません。 )(fwriteのパラメータ2は、ライン41上/var/www/html/WEBAPP/wa_start.phpに与えられた文字列リソースであることを期待:
PHPの警告:
2つ目は、それは私に次のようになりますあなたのコード
$stream_out = ssh2_fetch_stream($stream, SSH2_STREAM_STDIO);
で
'のvar_dump($のstream_out)のプット出力は;' fwriteのここで前 –