Yii2+node

Hi there,

We are trying to integrate chat functionality in our website(Yii2) using node.js.So far everything was going good.But now I need to run some php scripts from the js file.As such I’m able to run the php file from js but “Yii” application environment is not set if call any script in the php file.Take for example:

var phpScriptPath = "testing.php";

var argsString = "";


runner.exec("php " + phpScriptPath + " " +argsString, function(err, phpResponse, stderr) {


 if(err) console.log(err);


 data.response = phpResponse;


console.log( phpResponse );

});

But I am not able to get Yii::$app->user->identity->id in the same file.

Can anyone suggest me how to resolve this issue.

Regards

Ravi