user2439124
user2439124

Reputation: 291

php exec() returning 1 when running node js command

I need to run node js command from my php file. I am using exec() to do this. Here is my script

<?php

$ret = exec("node -v", $out, $err);
echo print_r($out);
?>

Here I am getting return value 1. How to fix this?

Upvotes: 0

Views: 1600

Answers (1)

Cybeaer
Cybeaer

Reputation: 43

http://php.net/manual/de/function.exec.php

Short summary:

So 1 means "Miscellaneous errors", have you tried running the command in the shell to see what happens?

Upvotes: 1

Related Questions