简体   繁体   中英

Can we execute node.js file using external PHP file?

I have a Node.js file which returns asterisk peer status on html file when I run command node -file name. Is it possible to create a PHP script to run that file on click of button? I tried PHP exec function but it didn't work ! I want that on click of button the script should start to execute and on another button it must stop the execution.

Node.js only supports JavaScript. Here is a tutorial on how to have PHP running with Node.js on the side.

http://blog.mixu.net/2011/01/04/nginx-php-fpm-and-node-js-install-on-centos-5-5/

Hope it helps :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM