If I want to call/execute node test.js file into demo.php file. I found one function called exec() which will execute the node command into PHP.
Here is my file where I have created two files are as follow.
test.js
console.log('welcome');
where I have simply added the message called "welcome". Now I have created one more file for PHP where I want to call above file and print the above message while I am called below file.
demp.php
<?php
$result = exec('node detail.js &',$out);
print_r($result);
print_r($out);
?>
Problem is that when I execute PHP file "http://localhost/demo.php" the output like below
Array ( )
and I cannot find any message in console.log.