douyue5856 2016-06-01 16:05
浏览 153

如何从php cli调用node js命令

I use Ubuntu 14.04 and install NodeJS. Now I want to call NodeJS command from phpcli, but it's not executing the command. This is my example code:

chdir('/var/www/html/kurento/video/');
$cmd = 'npm start';
var_dump(shell_exec($cmd));

Results in : string(87) " > kurento-one2many-call@6.2.2-dev start /var/www/html/kurento/video > node server.js "

  • 写回答

0条回答 默认 最新

    报告相同问题?