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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败
    • ¥15 MapReduce实现倒排索引失败
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码
    • ¥50 随机森林与房贷信用风险模型
    • ¥50 buildozer打包kivy app失败
    • ¥30 在vs2022里运行python代码
    • ¥15 不同尺寸货物如何寻找合适的包装箱型谱