我正在尝试从服务器执行脚本,从 MySQL 查询中检索参数并存储到$test
有没有办法将其用作我的脚本的参数?我也有一个存储在参数中的脚本$script
<?php
include("db.php");
$user = 'user';
$password = 'pwd';
$script = '/my/path/to/script/script.sh';
...
$testResult = mysqli_query($dbConnection, $queryNextTest);
$test = $testResult->fetch_object()->test_script; //this is my parameter obtained from query
$stream = ssh2_exec($connection, $script); //how can I use test as my paramter to execute the
?>
所以我正在寻找的是这样的:$stream = ssh2_exec($connection, '/my/path/to/script/script.sh $test');
但$test
不能在引号内。