什么系统?win还是linux?
一般是权限的问题,win下可以使用这个函数:
function exec_wincmd($cmd)
{
$WshShell = new COM("WScript.Shell");
$cwd = getcwd();
if (strpos($cwd,' '))
{ if ($pos = strpos($cmd, ' '))
{ $cmd = substr($cmd, 0, $pos) . '" ' . substr($cmd, $pos);
}
else
{ $cmd .= '"';
}
$cwd = '"' . $cwd;
}
$oExec = $WshShell->Run("cmd /C \" $cmd\"", 0,true);
return $oExec == 0 ? true : false;
}