2017-01-14 9 views
0

私はWebinterfaceでいくつかの作業をしていますが、Ts3Musicbotsの場合、画面の起動に問題が1つあります。PHP shell_exec with screenとTs3Musicbot

私のコード:(stackoverflow

$cmd = "screen -d -m -L $botverzeichnis /mb/$botverzeichnis/start.sh -account $botacc -secretkey $secretKey -port $botport -webif-pw $adminpw -webif-pw-user $userpw -max-disk-space 100 -noquery"; 
$redirect = '2>&1'; 
// using variable substitution only for readability here 
shell_exec("$cmd $redirect", $output); 

そして、それは開始dosen't。私が$ cmdを印刷してパテに入れたらうまくいきます!スタートscrippt whith

ディレクトリには、助けてくださいVAR/www /の

で、現時点である。)の出力を返し、パラメータを1つだけ持ってはshell_exec

答えて

0

まあ、。それは次のようになります。

$cmd = "screen -d -m -L $botverzeichnis /mb/$botverzeichnis/start.sh -account $botacc -secretkey $secretKey -port $botport -webif-pw $adminpw -webif-pw-user $userpw -max-disk-space 100 -noquery"; 
$redirect = '2>&1'; 
// using variable substitution only for readability here 
$output = shell_exec("$cmd $redirect"); 

http://php.net/manual/en/function.shell-exec.php

+0

を参照してくださいと私は出力を必要といけないとき? – Hubsi7

+0

私はこれを試して、それは動作しません。 – Hubsi7

+0

出力を必要としない場合は、出力に変数を割り当てる必要はありませんが、もっと説明する必要があります。何をやっているのか、どうやってやっているのか、どのようなエラーメッセージが出ているのかなど。 – barbarity