我使用Ubuntu 14.04并安装NodeJS。现在我想从phpcli调用NodeJS命令,但它没有执行命令。这是我的示例代码:
chdir('/var/www/html/kurento/video/');
$cmd = 'npm start';
var_dump(shell_exec($cmd));
结果: string(87)“> kurento-one2many-call@6.2.2-dev start / var / www / html / kurento / video> node server.js”