hi!
i want to execute a python script from php through proc_open() function of php.. i read a fine tutorial at
when i made following py script.
and linked it with php through following php code
it runs fine till first statement 'enter value'.. but at the next line raw_input() produces EOF error. im unable to send a value from php to python. i wonder what to do.. i came in python thread because the problem here is in python script
i want to execute a python script from php through proc_open() function of php.. i read a fine tutorial at
when i made following py script.
Code:
print 'enter value' input = raw_input() print input
Code:
<?php
$descriptorspec = array(
0 => array("pipe","r"),
1 => array("pipe","w"),
2 => array("file","./error.log","a")
) ;
$process = proc_open('test.py', $descriptorspec, $pipes);
print fgets($pipes[1]) ;
$p = 126;
fwrite($pipes[0], $P);
print fgets($pipes[1]) ;
fclose($pipes[1]);
fclose($pipes[0]);
proc_close($process);
?>
Comment