I am writing very simple script of scraper and i want to run this script using PHP. i have written below code for php.
$response = exec('node /home/user12/index.js > /home/user12/my_app_log.log 2>&1');
print_r($response);
this is returning response like this:
[ Resource {
url: 'https://stackoverflow.com/questions/39505659/executing-nodejs-script-file-in-php-using-exec',
filename: 'index.html',
type: null,
depth: 0,
parent: null,
children: [],
saved: false } ]
you can see i am getting saved:false but the same index.js file i run from terminal i got saved:true with html contents. what i am missing here could you please help me.