exec命令不起作用(php)


exec command not working (php)

我正在开发一个php应用程序,这是我的代码:

    <html>
<head>
<meta charset="UTF-8" />
</head>
<?php
if (isset($_POST['PLAY']))
{
exec("open /Applications/Chess.app");
}
?>
<form method="post">
<button name="PLAY">Play Chess</button><br>
</form>
</html>

但当我运行它并按下按钮时,应用程序不会打开。谢谢你的帮助!

/Applications/Chess.app前面有一个空格尝试

exec("open/Applications/Chess.app");