If you are working on Windows and try to proc_open an executable that contains spaces in its path, you will get into trouble.
But there's a workaround which works quite well. I have found it here: http://stackoverflow.com/a/4410389/1119601
For example, if you want to execute "C:\Program Files\nodejs\node.exe", you will get the error that the command could not be found.
Try this:
<?php
$cmd = 'C:\\Program Files\\nodejs\\node.exe';
if (strtolower(substr(PHP_OS,0,3)) === 'win') {
$cmd = sprintf('cd %s && %s', escapeshellarg(dirname($cmd)), basename($cmd));
}
?>