PHP将不会执行linux bash

时间:2018-09-05 19:09:04

标签: php html bash virtual-machine

我正在尝试执行一个html函数,该函数将使用php文件运行linux bash脚本并关闭一组无头虚拟机。 bash脚本将成功运行,但是php文件未执行该脚本。我确保将正确的行添加到sudoers。

#!/bin/bash
VM_NAME='wintgt1'
VBoxManage controlvm $VM_NAME poweroff

VM_NAME='wintgt2'
VBoxManage controlvm $VM_NAME poweroff

VM_NAME='wintgt3'
VBoxManage controlvm $VM_NAME poweroff

PHP

<?php
shell_exec("sudo /etc/init.d/portstop.sh");
header("Location: http://192.168.1.21/mod/page/view.php?id=133&forceview$");
?>

我在与此位置相同的位置还有其他脚本,这些脚本具有相同的sudoers条目和php文件。但是,此特定的php文件未执行脚本。 谢谢

0 个答案:

没有答案