2
Contributors
2
Replies
6
Views
3 Years
Discussion Span
Last Post by rubberman
0
<?php
$descriptorspec = array(
   0 => array("pipe", "r"),  
   1 => array("file", "xpdf","r")
);

$cwd = '/tmp';
$env = array('some_option' => 'aeiou');

$process = proc_open('php', $descriptorspec, $pipes, $cwd, $env);

if (is_resource($process)) {

    fwrite($pipes[0], '<?php print_r($_ENV); ?>');
    fclose($pipes[0]);

    echo stream_get_contents($pipes[1]);
    fclose($pipes[1]);

    $return_value = proc_close($process);

    echo "command returned $return_value\n";
}
?>

this is the code that i have written but it doesnt work. xpdf is the file that i want to run into the webpage.

0

This isn't C++, it is php. since you are already in the php environment, why do you use the '<php print... ?>' construct in the fwrite function on line 14?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.