如何从centos os在nginx服务器上执行node.js


How to execute node.js from php on centos os on nginx server?

嗨,我想执行我的notification.js,其中包括节点库,从php。我已经在我的本地pc上完成了它,其中有ubuntu os使用下面的代码,但相同的是在centos上不工作。有人知道怎么做吗?

<?php exec('/usr/bin/node '.JAVASCRIPT_PATH.'Server.js');?>

我能够解决这个问题,通过保持node_modules目录任何我的脚本文件,其中包括我的项目根目录下的节点库。